mirror of
https://github.com/duanhf2012/origin.git
synced 2026-03-06 22:27:36 +08:00
优化定时器
This commit is contained in:
@@ -128,11 +128,11 @@ func (slf *Module) ReleaseModule(moduleId int64){
|
||||
pModule.self.OnRelease()
|
||||
log.Debug("Release module %s.",slf.GetModuleName())
|
||||
for pTimer,_ := range pModule.mapActiveTimer {
|
||||
pTimer.Stop()
|
||||
pTimer.Close()
|
||||
}
|
||||
|
||||
for pCron,_ := range pModule.mapActiveCron {
|
||||
pCron.Stop()
|
||||
pCron.Close()
|
||||
}
|
||||
|
||||
delete(slf.child,moduleId)
|
||||
|
||||
@@ -139,7 +139,7 @@ func (slf *Service) Run() {
|
||||
analyzer = nil
|
||||
}
|
||||
case t := <- slf.dispatcher.ChanTimer:
|
||||
if t.IsStop() == false {
|
||||
if t.IsClose() == false {
|
||||
if slf.profiler != nil {
|
||||
analyzer = slf.profiler.Push(fmt.Sprintf("Timer_%s", t.AdditionData.(*timer.Timer).GetFunctionName()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user