|
|
@@ -51,9 +51,9 @@ func GetNextUint64() uint64 {
|
|
|
func EnableUpdate() {
|
|
|
var updater = &selfupdate.Updater{
|
|
|
CurrentVersion: version,
|
|
|
- ApiURL: "http://106.52.134.22:8180/",
|
|
|
- BinURL: "http://106.52.134.22:8180/",
|
|
|
- DiffURL: "http://106.52.134.22:8180/",
|
|
|
+ ApiURL: appConfig.UpdateUrl,
|
|
|
+ BinURL: appConfig.UpdateUrl,
|
|
|
+ DiffURL: appConfig.UpdateUrl,
|
|
|
Dir: "update/",
|
|
|
CmdName: appname, // app name
|
|
|
}
|
|
|
@@ -91,7 +91,11 @@ func WatchGoforever(args ...interface{}) interface{} {
|
|
|
// SyncTime 每半小时同步一次时间
|
|
|
func SyncTime(args ...interface{}) interface{} {
|
|
|
for {
|
|
|
- err := exec.Command("ntpclient", "-h", "106.52.134.22", "-s").Run()
|
|
|
+ if appConfig.NtpServer == "" {
|
|
|
+ time.Sleep(30 * time.Minute)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ err := exec.Command("ntpclient", "-h", appConfig.NtpServer, "-s").Run()
|
|
|
if err != nil {
|
|
|
logrus.Errorf("时间同步失败:%s", err.Error())
|
|
|
} else {
|