Skip to content

Commit

Permalink
Package logger:
Browse files Browse the repository at this point in the history
- fix missing ticker stop

Package monitor:
- fix missing ticker stop

Package server:
- fix missing ticker stop
  • Loading branch information
nabbar committed Aug 6, 2023
1 parent eb5c421 commit 0b1449f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions logger/hookfile/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions monitor/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ func (o *mon) poolIsRunning(ctx context.Context) error {
tms = time.Now()
)

defer tck.Stop()

for {
select {
case <-tck.C:
Expand Down
1 change: 0 additions & 1 deletion server/runner/ticker/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func (o *run) Stop(ctx context.Context) error {
}

var t = time.NewTicker(pollStop)

defer t.Stop()

for {
Expand Down

0 comments on commit 0b1449f

Please sign in to comment.