mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-31 07:30:32 +00:00
fix: use context.Background() in invokeCallback for scheduled tasks
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
aa1cb78a46
commit
c953f33722
@ -72,7 +72,7 @@ func (s *schedulerServiceImpl) ScheduleOneTime(ctx context.Context, delaySeconds
|
||||
|
||||
capturedID := scheduleID
|
||||
timer := timeAfterFunc(time.Duration(delaySeconds)*time.Second, func() {
|
||||
s.invokeCallback(ctx, capturedID)
|
||||
s.invokeCallback(context.Background(), capturedID)
|
||||
// Clean up the entry after firing
|
||||
s.mu.Lock()
|
||||
delete(s.schedules, capturedID)
|
||||
@ -97,7 +97,7 @@ func (s *schedulerServiceImpl) ScheduleRecurring(ctx context.Context, cronExpres
|
||||
|
||||
capturedID := scheduleID
|
||||
callback := func() {
|
||||
s.invokeCallback(ctx, capturedID)
|
||||
s.invokeCallback(context.Background(), capturedID)
|
||||
}
|
||||
|
||||
s.mu.Lock()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user