From 9413837b6adfc72a9b444a1be987615ce3753f79 Mon Sep 17 00:00:00 2001 From: dani <29378233+kheina@users.noreply.github.com> Date: Fri, 22 Sep 2023 16:00:10 -0400 Subject: [PATCH] pass storage an empty context so it can close cleanly (#3653) Co-authored-by: Danielle Miu <29378233+DanielleMiu@users.noreply.github.com> --- internal/daemon/worker/worker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/daemon/worker/worker.go b/internal/daemon/worker/worker.go index 64aadf66b..cd7a28ec2 100644 --- a/internal/daemon/worker/worker.go +++ b/internal/daemon/worker/worker.go @@ -257,7 +257,8 @@ func New(ctx context.Context, conf *Config) (*Worker, error) { } } - s, err := recordingStorageFactory(ctx, w.conf.RawConfig.Worker.RecordingStoragePath, plgClients, enableStorageLoopback) + // passing in an empty context so that storage can finish syncing during an emergency shutdown or interrupt + s, err := recordingStorageFactory(context.Background(), w.conf.RawConfig.Worker.RecordingStoragePath, plgClients, enableStorageLoopback) if err != nil { return nil, fmt.Errorf("error create recording storage: %w", err) }