Update census to run less frequently (#3346)

* update census to run less frequently

* Update internal/census/census_job.go

Co-authored-by: Michael Gaffney <mike@gaffney.cc>

* change nextrunin duration

---------

Co-authored-by: Michael Gaffney <mike@gaffney.cc>
This commit is contained in:
Michael MiltonandMichael Gaffney authored and GitHub committed 2023-07-05 15:33:18 -04:00
1 parent 02c1b74551
commit 23c40a0bc3
3 files changed
+53 -4

No files matched your search

+2 -4
View File
@@ -51,7 +51,6 @@ func (c *censusJob) Status() scheduler.JobStatus {
// Run performs the required work depending on the implementation.
// The context is used to notify the job that it should exit early.
func (c *censusJob) Run(ctx context.Context) error {
const op = "census.(censusJob).Run"
err := RunFn(ctx, c)
return err
}
@@ -61,10 +60,9 @@ func runInternal(ctx context.Context, c *censusJob) error {
}
// NextRunIn returns the duration until the next job run should be scheduled.
// We report as ready immediately after a successful run. This doesn't mean that
// this job will run immediately, only about as often as the configured scheduler interval.
// Census will run every hour to ensure any interrupted jobs will be re-attempted
func (c *censusJob) NextRunIn(_ context.Context) (time.Duration, error) {
return 0, nil
return time.Hour, nil
}
// Name is the unique name of the job.