mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-15 14:48:41 +01:00
Less waiting for cache to be ready
This commit is contained in:
parent
8a07bac2a2
commit
bcda53f115
2 changed files with 4 additions and 9 deletions
|
|
@ -47,13 +47,8 @@ func (w *warmer) AddAlbum(ctx context.Context, albumID string) {
|
|||
}
|
||||
|
||||
func (w *warmer) waitForCacheReady(ctx context.Context) {
|
||||
tick := time.NewTicker(time.Second)
|
||||
defer tick.Stop()
|
||||
for {
|
||||
<-tick.C
|
||||
if w.artworkCache.Ready(ctx) {
|
||||
return
|
||||
}
|
||||
for !w.artworkCache.Ready(ctx) {
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue