diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-07-28 13:23:45 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-07-28 13:23:45 +0200 |
| commit | 4db8a5f17d12ae4b29d3d0ad8b4891477f24c1ab (patch) | |
| tree | d562d489bda5c030052614b310030080c4158f24 /main.go | |
| parent | 1c359d89b95e59eb0d0cda76eccc8e64c323d078 (diff) | |
| download | WRMS-4db8a5f17d12ae4b29d3d0ad8b4891477f24c1ab.tar.gz WRMS-4db8a5f17d12ae4b29d3d0ad8b4891477f24c1ab.zip | |
fix deadlock when ordering the broadcasted events
Do not increment the global event id when sending "private" events
like the initial commands and search results.
Fixes: a93c5826172f835db604a2646d470ecfd72484cf
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -99,11 +99,13 @@ func searchHandler(w http.ResponseWriter, r *http.Request) { go func() { for result := range resultsChan { if len(result) > 0 { - conn.Send(wrms.newPrivateEvent(searchId, "search", result)) + // We can send the search results directly without going through the ordered channel + conn._sendEv(wrms.newPrivateEvent(searchId, "search", result)) } } - conn.Send(wrms.newPrivateEvent(searchId, "finish-search", nil)) + // We can send the search results directly without going through the ordered channel + conn._sendEv(wrms.newPrivateEvent(searchId, "finish-search", nil)) llog.Debug("searching for %v took %v", searchQuery, time.Since(start)) }() |
