session: remove dead env map (was stored but never read back)
This commit is contained in:
parent
57984dfa3f
commit
7070e56346
|
|
@ -61,10 +61,6 @@ type Session struct {
|
|||
log *olog.Logger
|
||||
sessionsDir string
|
||||
|
||||
// Environment
|
||||
envMu sync.RWMutex
|
||||
env map[string]string
|
||||
|
||||
// Mutable state protected by mu
|
||||
mu sync.RWMutex
|
||||
name string // friendly name
|
||||
|
|
@ -175,7 +171,6 @@ func New(cfg Config) *Session {
|
|||
ID: cfg.SessionID,
|
||||
name: name,
|
||||
Remote: cfg.Remote,
|
||||
env: make(map[string]string),
|
||||
agents: make([]*agent.Agent, 0, 1),
|
||||
log: log,
|
||||
sessionsDir: cfg.SessionsDir,
|
||||
|
|
@ -255,9 +250,6 @@ func (s *Session) Close() {
|
|||
|
||||
// SetEnv stores a session-scoped variable and propagates to all agents.
|
||||
func (s *Session) SetEnv(key, value string) {
|
||||
s.envMu.Lock()
|
||||
s.env[key] = value
|
||||
s.envMu.Unlock()
|
||||
for _, ag := range s.agents {
|
||||
ag.SetEnv(key, value)
|
||||
}
|
||||
|
|
@ -467,7 +459,6 @@ func NewEmpty(id string, ctx context.Context, cancel context.CancelFunc) *Sessio
|
|||
name: name,
|
||||
Ctx: ctx,
|
||||
Cancel: cancel,
|
||||
env: make(map[string]string),
|
||||
agents: make([]*agent.Agent, 0),
|
||||
log: log,
|
||||
sessionsDir: pkgSessionsDir,
|
||||
|
|
|
|||
Loading…
Reference in New Issue