Prevent scheduler callbacks after cancellation

This commit is contained in:
2026-08-09 00:52:31 +00:00
parent 0d8017e23f
commit ee600975f0
2 changed files with 76 additions and 0 deletions

View File

@@ -83,6 +83,9 @@ func (s *Scheduler) Run(ctx context.Context, fn func(context.Context) error) err
return err
}
defer release()
if err := ctx.Err(); err != nil {
return err
}
return fn(ctx)
}