Removed SSE messages
This commit is contained in:
parent
4dbe9cabb4
commit
dc322dd365
@ -1,7 +1,6 @@
|
|||||||
package sse
|
package sse
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/animenotifier/notify.moe/components/css"
|
"github.com/animenotifier/notify.moe/components/css"
|
||||||
@ -24,12 +23,10 @@ func Events(ctx *aero.Context) string {
|
|||||||
return ctx.Error(http.StatusUnauthorized, "Not logged in")
|
return ctx.Error(http.StatusUnauthorized, "Not logged in")
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(user.Nick, "receiving live events")
|
|
||||||
stream := aero.NewEventStream()
|
stream := aero.NewEventStream()
|
||||||
user.AddEventStream(stream)
|
user.AddEventStream(stream)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer fmt.Println(user.Nick, "disconnected, stop sending events")
|
|
||||||
defer user.RemoveEventStream(stream)
|
defer user.RemoveEventStream(stream)
|
||||||
|
|
||||||
// Send the ETag for the scripts
|
// Send the ETag for the scripts
|
||||||
|
Loading…
Reference in New Issue
Block a user