diff --git a/internal/lib/sync/sync.go b/internal/lib/sync/sync.go index 415b6dec3..69075e0c6 100644 --- a/internal/lib/sync/sync.go +++ b/internal/lib/sync/sync.go @@ -98,11 +98,11 @@ type Once struct { func (o *Once) Do(f func()) { if !o.done { o.m.Lock() - defer o.m.Unlock() if !o.done { o.done = true f() } + o.m.Unlock() } }