Skip to content

Commit

Permalink
Merge pull request #11 from aws-samples/develop
Browse files Browse the repository at this point in the history
fix:correct 'RunTicker' method
  • Loading branch information
YikaiHu authored Dec 21, 2022
2 parents 611b5c9 + 0c7ec75 commit 49f8b14
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 49f8b14

Please sign in to comment.