mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-13 10:47:19 +03:00
fix(server): use cancellable context instead of Sleep for initial insights delay (#3593)
* bugfix(server): use cancellable contet instead of sleep for initial insights delay * fix(server): initial delay time Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org> Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
0299e488b5
commit
f0302525a7
@ -208,7 +208,11 @@ func startInsightsCollector(ctx context.Context) func() error {
|
||||
return nil
|
||||
}
|
||||
log.Info(ctx, "Starting Insight Collector")
|
||||
time.Sleep(conf.Server.DevInsightsInitialDelay)
|
||||
select {
|
||||
case <-time.After(conf.Server.DevInsightsInitialDelay):
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
}
|
||||
ic := CreateInsights()
|
||||
ic.Run(ctx)
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user