fix: use context.Background() in invokeCallback for scheduled tasks

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2025-12-25 17:20:22 -05:00
parent aa1cb78a46
commit c953f33722

View File

@ -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()