You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/jobs/ip.go

18 lines
311 B

package jobs
import (
"go.dtapp.net/library/goip"
)
func (app *App) RefreshIp() {
xip := goip.GetOutsideIp()
if app.OutsideIp == "" || app.OutsideIp == "0.0.0.0" {
return
}
if app.OutsideIp == xip {
return
}
app.Db.Where("ips = ?", app.OutsideIp).Delete(&TaskIp{}) // 删除
app.OutsideIp = xip
}