From 2dfb9be3d54fde0fc0928e2355e92ddea947dbae Mon Sep 17 00:00:00 2001 From: Jonathan Crowther Date: Thu, 11 Apr 2024 09:33:55 -0400 Subject: [PATCH] Fix data race --- pkg/resources/counts/counts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/resources/counts/counts.go b/pkg/resources/counts/counts.go index 9a210eab..d4e7d9d9 100644 --- a/pkg/resources/counts/counts.go +++ b/pkg/resources/counts/counts.go @@ -181,7 +181,7 @@ func (s *Store) Watch(apiOp *types.APIRequest, schema *types.APISchema, w types. counts[schema.ID] = itemCount changedCount := map[string]ItemCount{ - schema.ID: itemCount, + schema.ID: *itemCount.DeepCopy(), } result <- Count{