session: follow PersistedSession → PersistedAgent rename
This commit is contained in:
parent
c07aef6bb9
commit
1ce845e83f
|
|
@ -37,7 +37,7 @@ func (s *Manager) persistSession(id string) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *Manager) removePersistedSession(id string) {
|
||||
func (s *Manager) removePersistedAgent(id string) {
|
||||
path := filepath.Join(s.activeSessionsDir(), id+".json")
|
||||
os.Remove(path)
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ func (s *Manager) restoreAllSessions() {
|
|||
|
||||
// Load all persisted session JSONs (fast, sequential disk reads)
|
||||
type loadedSession struct {
|
||||
ps *agent.PersistedSession
|
||||
ps *agent.PersistedAgent
|
||||
name string
|
||||
}
|
||||
var loaded []loadedSession
|
||||
|
|
@ -72,7 +72,7 @@ func (s *Manager) restoreAllSessions() {
|
|||
continue
|
||||
}
|
||||
path := filepath.Join(dir, e.Name())
|
||||
ps, err := agent.LoadPersistedSession(path)
|
||||
ps, err := agent.LoadPersistedAgent(path)
|
||||
if err != nil {
|
||||
s.cfg.Log.Error("restore session %s: %v", e.Name(), err)
|
||||
continue
|
||||
|
|
@ -98,7 +98,7 @@ func (s *Manager) restoreAllSessions() {
|
|||
wg.Wait()
|
||||
}
|
||||
|
||||
func (s *Manager) restoreSession(ps *agent.PersistedSession) error {
|
||||
func (s *Manager) restoreSession(ps *agent.PersistedAgent) error {
|
||||
cwd := ps.CWD
|
||||
if cwd == "" {
|
||||
cwd, _ = os.Getwd()
|
||||
|
|
@ -312,7 +312,7 @@ func (s *Manager) KillSession(id string) {
|
|||
if sess != nil {
|
||||
sess.Cancel()
|
||||
sess.Core.Close()
|
||||
s.removePersistedSession(id)
|
||||
s.removePersistedAgent(id)
|
||||
s.cfg.Log.Info("killed session %s", id)
|
||||
if s.cfg.OnSessionKilled != nil {
|
||||
s.cfg.OnSessionKilled(id)
|
||||
|
|
|
|||
Reference in New Issue