mirror of https://github.com/wh1te909/rmmagent.git
clear cache when recovering salt to fix rare msgpack errors
This commit is contained in:
parent
beed2ddcea
commit
567d870a47
|
@ -457,6 +457,13 @@ func (a *WindowsAgent) RecoverSalt() {
|
||||||
|
|
||||||
_, _ = CMD(a.Nssm, []string{"stop", saltSVC}, 120, false)
|
_, _ = CMD(a.Nssm, []string{"stop", saltSVC}, 120, false)
|
||||||
a.ForceKillSalt()
|
a.ForceKillSalt()
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
|
cacheDir := filepath.Join(a.SystemDrive, "\\salt", "var", "cache", "salt", "minion")
|
||||||
|
a.Logger.Debugln("Clearing salt cache in", cacheDir)
|
||||||
|
err := os.RemoveAll(cacheDir)
|
||||||
|
if err != nil {
|
||||||
|
a.Logger.Debugln(err)
|
||||||
|
}
|
||||||
_, _ = CMD("ipconfig", []string{"flushdns"}, 15, false)
|
_, _ = CMD("ipconfig", []string{"flushdns"}, 15, false)
|
||||||
a.Logger.Debugln("Salt recovery completed on", a.Hostname)
|
a.Logger.Debugln("Salt recovery completed on", a.Hostname)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue