Skip to content

Commit 49f8b14

Browse files
authored
Merge pull request #11 from aws-samples/develop
fix:correct 'RunTicker' method
2 parents 611b5c9 + 0c7ec75 commit 49f8b14

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

dth/job.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,10 @@ func RunTicker(ctx context.Context, cfg *JobConfig) {
137137
t := &JobTicker{}
138138
t.updateTimer()
139139
for {
140-
select {
141-
case <-ctx.Done():
142-
log.Printf("timer has been stopped")
143-
t.timer.Stop()
144-
case <-t.timer.C:
145-
log.Printf("ticker update S3 Credentials")
146-
updateCreds(ctx, cfg)
147-
t.updateTimer()
148-
}
140+
<-t.timer.C
141+
log.Printf("ticker update S3 Credentials")
142+
updateCreds(ctx, cfg)
143+
t.updateTimer()
149144
}
150145
}
151146

0 commit comments

Comments
 (0)