Description
@julienduchesne raised this in a comment on one of our recent PRs.
It's weird that the Check
interface has the recheck interval as a parameter on its function
wait-for-github/internal/utils/utils.go
Line 32 in 94d159d
The check functions are not actually doing the waiting themselves. That happens in RunUntilCancelledOrTimeout
. This is where the ticker is created, and it shouldn't need to pass the interval further on.
We only really do this so we can log that we are rechecking in period
.
We can either move that particular log statement up a few levels, or restructure how we pass around loggers, and make sure there's always one available that has sensible fields set on it. Either way the signature of Check
should be Check(ctx context.Context) error
.