From 103795d33a09728d7619e73014d507505ff121e2 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 27 Apr 2022 15:06:20 +0100 Subject: [PATCH] Defer cancel on shutdown context --- setup/base/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/base/base.go b/setup/base/base.go index 51c43198a..03ea2ad7e 100644 --- a/setup/base/base.go +++ b/setup/base/base.go @@ -472,7 +472,7 @@ func (b *BaseDendrite) SetupAndServeHTTP( b.WaitForShutdown() ctx, cancel := context.WithCancel(context.Background()) - cancel() + defer cancel() _ = internalServ.Shutdown(ctx) _ = externalServ.Shutdown(ctx)