Skip to content

Commit

Permalink
feat: adjust writing to the correct event
Browse files Browse the repository at this point in the history
  • Loading branch information
owulveryck committed Feb 12, 2024
1 parent 93bd2c4 commit a9da18c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/stream/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ func (h *StreamHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
select {
case <-r.Context().Done():
return
case <-eventC:
writing = true
stopWriting.Reset(2 * time.Second)
case event := <-eventC:
if event.Code == 24 {
writing = true
stopWriting.Reset(1500 * time.Millisecond)
}
case <-stopWriting.C:
writing = false
case <-ticker.C:
Expand Down

0 comments on commit a9da18c

Please sign in to comment.