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.
18 lines
311 B
18 lines
311 B
2 years ago
|
package jobs
|
||
|
|
||
2 years ago
|
import (
|
||
|
"go.dtapp.net/library/goip"
|
||
|
)
|
||
2 years ago
|
|
||
|
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
|
||
|
}
|