From 37b52f94c7f44bd4ae8c9836114759a3e234f7f4 Mon Sep 17 00:00:00 2001 From: Mikayla Toffler Date: Mon, 16 Dec 2024 16:10:38 -0500 Subject: [PATCH] move lock outside of once.Do --- internal/contribroutines/contribroutines.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/contribroutines/contribroutines.go b/internal/contribroutines/contribroutines.go index b2a7282883..2b9e6352c0 100644 --- a/internal/contribroutines/contribroutines.go +++ b/internal/contribroutines/contribroutines.go @@ -13,9 +13,9 @@ var ( ) func Stop() { + mu.Lock() + defer mu.Unlock() once.Do(func() { - mu.Lock() - defer mu.Unlock() close(stop) }) }