mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-10 20:10:24 +08:00
执行一般命令时不运行init()中内容
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/events"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/goman"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
|
||||
@@ -21,6 +22,10 @@ var hasSynced = false
|
||||
var sharedClockManager = NewClockManager()
|
||||
|
||||
func init() {
|
||||
if !teaconst.IsMain {
|
||||
return
|
||||
}
|
||||
|
||||
events.On(events.EventLoaded, func() {
|
||||
goman.New(sharedClockManager.Start)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user