Commit 16334ca3 authored by szh's avatar szh

autossh 定期清理链接

parent c93e926a
......@@ -573,11 +573,11 @@ func AutoSSHClean() error {
return err
}
tlog.Info("getPaiProcessInfo","pai",*pai)
if pai.Stime > 0 && (time.Now().Unix()-pai.Stime) > 72 * 3600 && pai.Pid > 0 {
err := KillAutoSsh(pai.Pid)
if err != nil {
tlog.Error("KillAutoSsh","err",err)
return err
}
tlog.Info("KillAutoSsh Success","pid",pai.Pid)
}
......@@ -597,7 +597,7 @@ func getPaiProcessInfo() (*PaiProcessInfo,error) {
cmd.Stdout = &buf
err := cmd.Run()
if err != nil {
tlog.Error("getPaiProcessInfo","err",err)
tlog.Error("getPaiProcessInfo cmd","err",err)
return nil,err
}
list := strings.Split(buf.String()," ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment