fix(bugseti): acquire mutex in NewQueueService before load()
q.load() accesses shared state (issues, seen, current) without holding the mutex, creating a race condition. Wrap the call with q.mu.Lock(). Fixes #52 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
79b88c79fe
commit
6bf271e4b1
1 changed files with 2 additions and 0 deletions
|
|
@ -103,7 +103,9 @@ func NewQueueService(config *ConfigService) *QueueService {
|
||||||
seen: make(map[string]bool),
|
seen: make(map[string]bool),
|
||||||
}
|
}
|
||||||
heap.Init(&q.issues)
|
heap.Init(&q.issues)
|
||||||
|
q.mu.Lock()
|
||||||
q.load() // Load persisted queue
|
q.load() // Load persisted queue
|
||||||
|
q.mu.Unlock()
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue