@@ -126,10 +126,7 @@ func main() {
126
126
emergencyShutdown := func () {
127
127
cancel ()
128
128
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 ())
133
130
}
134
131
135
132
cloningSvc := cloning .NewBase (& cfg .Cloning , provisioner , tm , observingChan )
@@ -185,16 +182,18 @@ func main() {
185
182
<- shutdownCh
186
183
cancel ()
187
184
188
- shutdownCtx , shutdownCancel := context .WithTimeout (context .Background (), shutdownTimeout )
185
+ ctxBackground := context .Background ()
186
+
187
+ shutdownCtx , shutdownCancel := context .WithTimeout (ctxBackground , shutdownTimeout )
189
188
defer shutdownCancel ()
190
189
191
190
if err := server .Shutdown (shutdownCtx ); err != nil {
192
191
log .Msg (err )
193
192
}
194
193
195
- shutdownDatabaseLabEngine (shutdownCtx , docker , engProps , pm .First ())
194
+ shutdownDatabaseLabEngine (ctxBackground , docker , engProps , pm .First ())
196
195
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 ()})
198
197
}
199
198
200
199
func getEngineProperties (ctx context.Context , dockerCLI * client.Client , cfg * config.Config ) (global.EngineProps , error ) {
0 commit comments