mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
实时检测module释放
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user