From 59c217b666d02d0753ca6d444b6445b06d20507e Mon Sep 17 00:00:00 2001 From: Varakh Date: Sat, 27 Apr 2024 09:13:51 +0200 Subject: [PATCH] fix(locks): access to in-memory locks inside scheduled background tasks are now properly guarded --- util/locker_memory.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/locker_memory.go b/util/locker_memory.go index b48fc8f..7c22691 100644 --- a/util/locker_memory.go +++ b/util/locker_memory.go @@ -63,7 +63,9 @@ func (l *InMemoryLockRegistry) Clear() { // Exists exists a lock by name func (l *InMemoryLockRegistry) Exists(name string) bool { + l.mu.Lock() _, exists := l.locks[name] + l.mu.Unlock() return exists }