Use the request context for cancelation, not a background context
This also fixes an improperly written server deletion listener to look at the correct context cancelation. Theoretically this should help address the issues in pterodactyl/panel#3596 but I'm not really sure how that happens, and theres no steps for reproduction.
This commit is contained in:
@@ -44,11 +44,11 @@ func (w *WebsocketBag) Remove(u uuid.UUID) {
|
||||
w.mu.Unlock()
|
||||
}
|
||||
|
||||
// CancelAll cancels all the stored cancel functions which has the effect of disconnecting
|
||||
// every listening websocket for the server.
|
||||
// CancelAll cancels all the stored cancel functions which has the effect of
|
||||
// disconnecting every listening websocket for the server.
|
||||
func (w *WebsocketBag) CancelAll() {
|
||||
w.mu.Lock()
|
||||
w.mu.Unlock()
|
||||
defer w.mu.Unlock()
|
||||
|
||||
if w.conns != nil {
|
||||
for _, cancel := range w.conns {
|
||||
|
||||
Reference in New Issue
Block a user