Skip to content

Commit 9f0e5f6

Browse files
committed
Check if the mux server is used before trying to shut it down.
1 parent 13c6275 commit 9f0e5f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

runtime/runtime.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,14 @@ func (s *Runtime) StartWithListenter(lis net.Listener, startup fluffycore_contra
292292
s.Wait()
293293
log.Info().Msg("Interupt triggered")
294294
si.Server.Stop()
295-
si.ServerGRPCGatewayMux.Shutdown(context.Background())
295+
if si.ServerGRPCGatewayMux != nil {
296+
si.ServerGRPCGatewayMux.Shutdown(context.Background())
297+
}
296298
startup.OnPostServerShutdown()
297299
si.Future.Join()
298-
si.FutureGRPCGatewayMux.Join()
300+
if si.FutureGRPCGatewayMux != nil {
301+
si.FutureGRPCGatewayMux.Join()
302+
}
299303
}
300304
func LoadConfig(configOptions *fluffycore_contract_runtime.ConfigOptions) error {
301305
v := viper.NewWithOptions(viper.KeyDelimiter("__"))

0 commit comments

Comments
 (0)