Skip to content

Commit

Permalink
Fix panics on closed channel sends
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Jan 4, 2022
1 parent 9755494 commit 85ede6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion roomserver/internal/input/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ func (r *Inputer) InputRoomEvents(
} else {
hooks.Run(hooks.KindNewEventPersisted, inputRoomEvent.Event)
}
responses <- err
select {
case <-ctx.Done():
default:
responses <- err
}
})
}
for i := 0; i < len(request.InputRoomEvents); i++ {
Expand Down

0 comments on commit 85ede6d

Please sign in to comment.