Commit ec5ffaf5 authored by szh's avatar szh

up

parent d8a5312f
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"os/exec" "os/exec"
"sync" "sync"
"time" "time"
"strings"
) )
func GennerPort()(port,daemonPort int,err error){ func GennerPort()(port,daemonPort int,err error){
...@@ -91,7 +92,25 @@ func reKeygen(){ ...@@ -91,7 +92,25 @@ func reKeygen(){
f.Close() f.Close()
} }
func CleanUp(){ func CleanUp(){
var buff bytes.Buffer
netstat:=exec.Command(setting.Chain33Pai.NetStat)
netstat.Stdout=&buff
idSelector:=strings.Split(buff.String(),"\n")
if len(idSelector)==0{//没有映射端口存在,即没有需要处理的反馈
reKeygen()//清空authorized_keys
models.DropFeedBack()//清空数据库记录
return
}
for _,v:=range idSelector{
if models.IsComplete(v){
models.DelFeedBack(v)
}
}
}
func CleanUp1(){
list,err := models.GetAllFeedBackList() list,err := models.GetAllFeedBackList()
if err != nil { if err != nil {
fmt.Println("GetAllFeedBackList",err) fmt.Println("GetAllFeedBackList",err)
......
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