From a3b8682d441bd486f933deff78de994bb00fb9a0 Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 7 Feb 2023 19:17:50 -0500 Subject: [PATCH] Fix polling of buffered scrobbles --- core/scrobbler/buffered_scrobbler.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/scrobbler/buffered_scrobbler.go b/core/scrobbler/buffered_scrobbler.go index 80c7f6079..047e43eef 100644 --- a/core/scrobbler/buffered_scrobbler.go +++ b/core/scrobbler/buffered_scrobbler.go @@ -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 { @@ -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 + } } }