Skip to content

Commit

Permalink
fix:correct 'RunTicker' method
Browse files Browse the repository at this point in the history
  • Loading branch information
System Administrator committed Dec 20, 2022
1 parent 611b5c9 commit 0c7ec75
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions dth/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,10 @@ func RunTicker(ctx context.Context, cfg *JobConfig) {
t := &JobTicker{}
t.updateTimer()
for {
select {
case <-ctx.Done():
log.Printf("timer has been stopped")
t.timer.Stop()
case <-t.timer.C:
log.Printf("ticker update S3 Credentials")
updateCreds(ctx, cfg)
t.updateTimer()
}
<-t.timer.C
log.Printf("ticker update S3 Credentials")
updateCreds(ctx, cfg)
t.updateTimer()
}
}

Expand Down

0 comments on commit 0c7ec75

Please sign in to comment.