Skip to content

Commit

Permalink
调试状态下,不用判断服务端的配置
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Sep 18, 2024
1 parent 287b6d7 commit 49f4e9d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ func (module Module) DependsModule() []modules.FarseerModule {
}

func (module Module) PreInitialize() {
// 配置时间轮
timingWheel.Start()

// 调试状态下,不开启与调度中心的通信
if configure.GetBool("FSchedule.Debug.Enable") {
flog.Warning("FSchedule当前为调试状态,将模拟调用任务")
return
}

// 服务端配置
defaultServer = serverVO{
Address: configure.GetSlice("FSchedule.Server.Address"),
Expand All @@ -26,16 +35,10 @@ func (module Module) PreInitialize() {
panic("调度中心的地址[FSchedule.Server.Address]未配置")
}

// 客户端配置
timingWheel.Start()
}

func (module Module) PostInitialize() {
// 调试状态下,不开启与调度中心的通信
if configure.GetBool("FSchedule.Debug.Enable") {
flog.Warning("FSchedule当前为调试状态,将模拟调用任务")
return
}

}

func (module Module) Shutdown() {
Expand Down

0 comments on commit 49f4e9d

Please sign in to comment.