From 6d8a49831f23df789fbbf19a0abb1099b11f6f30 Mon Sep 17 00:00:00 2001 From: Daniel Levi-Minzi Date: Fri, 10 Jan 2025 12:45:55 -0500 Subject: [PATCH] inherit worker context --- pkg/worker/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go index 333589b40..9fa5a2102 100644 --- a/pkg/worker/worker.go +++ b/pkg/worker/worker.go @@ -272,7 +272,7 @@ func (s *Worker) Run() error { if !exists { log.Info().Str("container_id", containerId).Msg("running container") - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(s.ctx) eventbus := common.NewEventBus(s.redisClient, common.EventBusSubscriber{Type: common.EventType("stop-build" + "-" + containerId), Callback: func(e *common.Event) bool { log.Info().Str("container_id", containerId).Msg("received stop build event") cancel()