From 026305318bef18bd588a87363a6f5fb94cfdc727 Mon Sep 17 00:00:00 2001 From: Dmytro Kislov Date: Tue, 15 Sep 2020 14:33:14 +0100 Subject: [PATCH] err check --- pkg/gameserverallocations/allocator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/gameserverallocations/allocator.go b/pkg/gameserverallocations/allocator.go index cb66faca11..f02b68f4ae 100644 --- a/pkg/gameserverallocations/allocator.go +++ b/pkg/gameserverallocations/allocator.go @@ -345,7 +345,8 @@ func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAlloca request.MultiClusterSetting.Enabled = false request.Namespace = connectionInfo.Namespace - ctx, _ := context.WithTimeout(context.Background(), totalRemoteAllocationTimeout) + ctx, cancel := context.WithTimeout(context.Background(), totalRemoteAllocationTimeout) + defer cancel() // nolint: errcheck // Retry on remote call failures. err = Retry(remoteAllocationRetry, func() error { for i, ip := range connectionInfo.AllocationEndpoints {