mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-06 18:10:26 +08:00
优化代码
This commit is contained in:
@@ -19,12 +19,13 @@ func init() {
|
|||||||
timeZone = "Asia/Shanghai"
|
timeZone = "Asia/Shanghai"
|
||||||
}
|
}
|
||||||
|
|
||||||
location, err := time.LoadLocation(sharedNodeConfig.TimeZone)
|
|
||||||
if err != nil {
|
|
||||||
remotelogs.Error("TIMEZONE", "change time zone failed: "+err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if lastTimeZone != timeZone {
|
if lastTimeZone != timeZone {
|
||||||
|
location, err := time.LoadLocation(timeZone)
|
||||||
|
if err != nil {
|
||||||
|
remotelogs.Error("TIMEZONE", "change time zone failed: "+err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
remotelogs.Println("TIMEZONE", "change time zone to '"+timeZone+"'")
|
remotelogs.Println("TIMEZONE", "change time zone to '"+timeZone+"'")
|
||||||
time.Local = location
|
time.Local = location
|
||||||
lastTimeZone = timeZone
|
lastTimeZone = timeZone
|
||||||
|
|||||||
Reference in New Issue
Block a user