mirror of
https://github.com/lukaszraczylo/claude-mnemonic.git
synced 2026-10-14 05:30:11 +00:00
fixup! chore: update marketplace for v0.11.37
march-improvements
This commit is contained in:
@@ -75,6 +75,7 @@ type Manager struct {
|
||||
onDeleted func(int64)
|
||||
cancel context.CancelFunc
|
||||
ProcessNotify chan struct{}
|
||||
wg sync.WaitGroup
|
||||
mu sync.RWMutex
|
||||
}
|
||||
|
||||
@@ -89,12 +90,14 @@ func NewManager(sessionStore *gorm.SessionStore) *Manager {
|
||||
ProcessNotify: make(chan struct{}, 1),
|
||||
}
|
||||
// Start background cleanup goroutine
|
||||
m.wg.Add(1)
|
||||
go m.cleanupLoop()
|
||||
return m
|
||||
}
|
||||
|
||||
// cleanupLoop periodically removes stale sessions.
|
||||
func (m *Manager) cleanupLoop() {
|
||||
defer m.wg.Done()
|
||||
ticker := time.NewTicker(CleanupInterval)
|
||||
defer ticker.Stop()
|
||||
|
||||
@@ -350,6 +353,7 @@ func (m *Manager) DeleteSession(sessionDBID int64) {
|
||||
func (m *Manager) ShutdownAll(ctx context.Context) {
|
||||
// Stop cleanup goroutine
|
||||
m.cancel()
|
||||
m.wg.Wait()
|
||||
|
||||
m.mu.Lock()
|
||||
sessionIDs := make([]int64, 0, len(m.sessions))
|
||||
|
||||
@@ -952,6 +952,7 @@ func TestCleanupLoop_ExitsOnCancel(t *testing.T) {
|
||||
|
||||
// Start cleanup loop in goroutine
|
||||
done := make(chan struct{})
|
||||
manager.wg.Add(1)
|
||||
go func() {
|
||||
manager.cleanupLoop()
|
||||
close(done)
|
||||
|
||||
Reference in New Issue
Block a user