From 851b02b646a824c352fe8e57ab22ca181b82d925 Mon Sep 17 00:00:00 2001 From: boyce Date: Thu, 28 Feb 2019 16:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=A3=80=E6=B5=8Bmodule?= =?UTF-8?q?=E9=87=8A=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/Module.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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: