Enha: sse update on actions
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golias/broker"
|
||||
"golias/config"
|
||||
"golias/pkg/cache"
|
||||
@ -9,7 +8,6 @@ import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -28,18 +26,6 @@ func init() {
|
||||
cfg = config.LoadConfigOrDefault("")
|
||||
Notifier = broker.NewBroker()
|
||||
go Notifier.Listen()
|
||||
ticker := time.NewTicker(2 * time.Second)
|
||||
go func() {
|
||||
counter := 0
|
||||
for {
|
||||
<-ticker.C
|
||||
Notifier.Notifier <- broker.NotificationEvent{
|
||||
EventName: "test",
|
||||
Payload: fmt.Sprintf("%v test call of notifier", counter),
|
||||
}
|
||||
counter++
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
var roundWords = map[string]string{
|
||||
|
Reference in New Issue
Block a user