Skip to content

Check functions do not need to know the interval #67

Closed
@iainlane

Description

@iainlane

@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

Check(ctx context.Context, recheckInterval time.Duration) error

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.

Metadata

Metadata

Assignees

Labels

good-first-issueGood issue for new contributors to the project: not too simple, and would have decent impact

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions