@@ -126,10 +126,7 @@ func main() {
126126 emergencyShutdown := func () {
127127 cancel ()
128128
129- shutdownCtx , shutdownCancel := context .WithTimeout (context .Background (), shutdownTimeout )
130- defer shutdownCancel ()
131-
132- shutdownDatabaseLabEngine (shutdownCtx , docker , engProps , pm .First ())
129+ shutdownDatabaseLabEngine (context .Background (), docker , engProps , pm .First ())
133130 }
134131
135132 cloningSvc := cloning .NewBase (& cfg .Cloning , provisioner , tm , observingChan )
@@ -185,16 +182,18 @@ func main() {
185182 <- shutdownCh
186183 cancel ()
187184
188- shutdownCtx , shutdownCancel := context .WithTimeout (context .Background (), shutdownTimeout )
185+ ctxBackground := context .Background ()
186+
187+ shutdownCtx , shutdownCancel := context .WithTimeout (ctxBackground , shutdownTimeout )
189188 defer shutdownCancel ()
190189
191190 if err := server .Shutdown (shutdownCtx ); err != nil {
192191 log .Msg (err )
193192 }
194193
195- shutdownDatabaseLabEngine (shutdownCtx , docker , engProps , pm .First ())
194+ shutdownDatabaseLabEngine (ctxBackground , docker , engProps , pm .First ())
196195 cloningSvc .SaveClonesState ()
197- tm .SendEvent (context . Background () , telemetry .EngineStoppedEvent , telemetry.EngineStopped {Uptime : server .Uptime ()})
196+ tm .SendEvent (ctxBackground , telemetry .EngineStoppedEvent , telemetry.EngineStopped {Uptime : server .Uptime ()})
198197}
199198
200199func getEngineProperties (ctx context.Context , dockerCLI * client.Client , cfg * config.Config ) (global.EngineProps , error ) {
0 commit comments