Skip to content

Commit

Permalink
Fix polling of buffered scrobbles
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Feb 8, 2023
1 parent 0bbb549 commit a3b8682
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/scrobbler/buffered_scrobbler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/utils/pl"
)

func newBufferedScrobbler(ds model.DataStore, s Scrobbler, service string) *bufferedScrobbler {
Expand Down Expand Up @@ -57,7 +56,12 @@ func (b *bufferedScrobbler) run(ctx context.Context) {
b.sendWakeSignal()
})
}
<-pl.ReadOrDone(ctx, b.wakeSignal)
select {
case <-b.wakeSignal:
continue
case <-ctx.Done():
return
}
}
}

Expand Down

0 comments on commit a3b8682

Please sign in to comment.