diff --git a/logger/hookfile/system.go b/logger/hookfile/system.go index a053673a..91469120 100644 --- a/logger/hookfile/system.go +++ b/logger/hookfile/system.go @@ -106,6 +106,7 @@ func (o *hkf) Run(ctx context.Context) { t = time.NewTicker(time.Second) e error ) + defer t.Stop() defer func() { if rec := recover(); rec != nil { diff --git a/monitor/server.go b/monitor/server.go index ed86f246..c13f27f1 100644 --- a/monitor/server.go +++ b/monitor/server.go @@ -121,6 +121,8 @@ func (o *mon) poolIsRunning(ctx context.Context) error { tms = time.Now() ) + defer tck.Stop() + for { select { case <-tck.C: diff --git a/server/runner/ticker/model.go b/server/runner/ticker/model.go index b56c43f5..7f9aa83d 100644 --- a/server/runner/ticker/model.go +++ b/server/runner/ticker/model.go @@ -68,7 +68,6 @@ func (o *run) Stop(ctx context.Context) error { } var t = time.NewTicker(pollStop) - defer t.Stop() for {