diff --git a/modules/eventsource/manager.go b/modules/eventsource/manager.go index 7ed2a8290..730cacd94 100644 --- a/modules/eventsource/manager.go +++ b/modules/eventsource/manager.go @@ -77,13 +77,3 @@ func (m *Manager) SendMessage(uid int64, message *Event) { messenger.SendMessage(message) } } - -// SendMessageBlocking sends a message to a particular user -func (m *Manager) SendMessageBlocking(uid int64, message *Event) { - m.mutex.Lock() - messenger, ok := m.messengers[uid] - m.mutex.Unlock() - if ok { - messenger.SendMessageBlocking(message) - } -} diff --git a/modules/eventsource/messenger.go b/modules/eventsource/messenger.go index 6df26716b..378e71712 100644 --- a/modules/eventsource/messenger.go +++ b/modules/eventsource/messenger.go @@ -66,12 +66,3 @@ func (m *Messenger) SendMessage(message *Event) { } } } - -// SendMessageBlocking sends the message to all registered channels and ensures it gets sent -func (m *Messenger) SendMessageBlocking(message *Event) { - m.mutex.Lock() - defer m.mutex.Unlock() - for i := range m.channels { - m.channels[i] <- message - } -} diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 318180021..3f1ed54bd 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -408,7 +408,7 @@ func HandleSignOut(ctx *context.Context) { // SignOut sign out from login status func SignOut(ctx *context.Context) { if ctx.Doer != nil { - eventsource.GetManager().SendMessageBlocking(ctx.Doer.ID, &eventsource.Event{ + eventsource.GetManager().SendMessage(ctx.Doer.ID, &eventsource.Event{ Name: "logout", Data: ctx.Session.ID(), })