Fix panics on closed channel sends

This commit is contained in:
Neil Alexander 2022-01-04 14:07:04 +00:00
parent 9755494a98
commit 85ede6d64b
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -119,7 +119,11 @@ func (r *Inputer) InputRoomEvents(
} else { } else {
hooks.Run(hooks.KindNewEventPersisted, inputRoomEvent.Event) hooks.Run(hooks.KindNewEventPersisted, inputRoomEvent.Event)
} }
responses <- err select {
case <-ctx.Done():
default:
responses <- err
}
}) })
} }
for i := 0; i < len(request.InputRoomEvents); i++ { for i := 0; i < len(request.InputRoomEvents); i++ {