Commit c93e926a authored by szh's avatar szh

autossh 定期清理链接

parent 492bf342
......@@ -567,11 +567,13 @@ type PaiProcessInfo struct {
func AutoSSHClean() error {
pai,err := getPaiProcessInfo()
tlog.Info("getPaiProcessInfo","pai",*pai)
if err != nil {
tlog.Error("getPaiProcessInfo","err",err)
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 {
......
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