Gracefully shutdown server (#3896)

This commit is contained in:
6543
2024-07-13 16:46:01 -07:00
committed by GitHub
parent 30cd800110
commit 757f5a58e2
13 changed files with 375 additions and 164 deletions

View File

@@ -27,9 +27,9 @@ import (
// WithTaskStore returns a queue that is backed by the TaskStore. This
// ensures the task Queue can be restored when the system starts.
func WithTaskStore(q Queue, s store.Store) Queue {
func WithTaskStore(ctx context.Context, q Queue, s store.Store) Queue {
tasks, _ := s.TaskList()
if err := q.PushAtOnce(context.Background(), tasks); err != nil {
if err := q.PushAtOnce(ctx, tasks); err != nil {
log.Error().Err(err).Msg("PushAtOnce failed")
}
return &persistentQueue{q, s}