only remove keys if we have them
This commit is contained in:
parent
5689216348
commit
c2842975db
14
agent.go
14
agent.go
@ -268,14 +268,16 @@ func (t *Traygent) RemoveAll() error {
|
|||||||
return errLocked
|
return errLocked
|
||||||
}
|
}
|
||||||
|
|
||||||
t.mu.Lock()
|
if len(t.keys) > 0 {
|
||||||
klen := len(t.keys)
|
t.mu.Lock()
|
||||||
t.keys = nil
|
klen := len(t.keys)
|
||||||
|
t.keys = nil
|
||||||
|
|
||||||
t.log("All keys removed", "removed %d keys from agent", klen)
|
t.log("All keys removed", "removed %d keys from agent", klen)
|
||||||
go func() { t.rmChan <- "all" }()
|
go func() { t.rmChan <- "all" }()
|
||||||
|
|
||||||
t.mu.Unlock()
|
t.mu.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user