fix: session persistence across restart
Shutdown() was calling KillSession() which deleted the persisted JSON files immediately after saveAllSessions() wrote them. Now Shutdown() closes sessions directly without removing persistence files, allowing restoreAllSessions() to find them on next start.
This commit is contained in:
parent
aa467e9b3c
commit
9d21601edf
|
|
@ -803,7 +803,15 @@ func (s *Manager) Shutdown() {
|
|||
}
|
||||
s.mu.Unlock()
|
||||
for _, id := range ids {
|
||||
s.KillSession(id)
|
||||
s.mu.Lock()
|
||||
sess := s.sessions[id]
|
||||
delete(s.sessions, id)
|
||||
s.mu.Unlock()
|
||||
if sess != nil {
|
||||
sess.Cancel()
|
||||
sess.Core.Close()
|
||||
s.cfg.Log.Info("shutdown session %s", id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in New Issue