diff --git a/service/Module.go b/service/Module.go index 34af858..beafcf5 100644 --- a/service/Module.go +++ b/service/Module.go @@ -270,13 +270,14 @@ func (slf *BaseModule) RunModule(module IModule) { slf.WaitGroup.Add(1) defer slf.WaitGroup.Done() for { + if atomic.LoadInt32(&slf.corouterstatus) != 0 { + module.OnEndRun() + GetLogger().Printf(LEVER_INFO, "OnEndRun module %T ...", module) + break + } + //每500ms检查退出 if timer.CheckTimeOut() { - if atomic.LoadInt32(&slf.corouterstatus) != 0 { - module.OnEndRun() - GetLogger().Printf(LEVER_INFO, "OnEndRun module %T ...", module) - break - } select { case <-slf.ExitChan: