perses / perses/common

Cron Task does not start at precise frequency

Open
#285 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
7
Forks
8
Avg merge
2h 57m
Merged PRs (30d)
5

Description

Based on user feedback, it appears the cron task is not starting at a precise frequency.

The issue appears when you are running a cron task every 5 minutes for example. Instead of starting every 5 seconds regardless the time it took to run it, it is running 5s + the time it took to run at previous time.

Example:

Image

First run completed at 18:45:05 sec and next starts at 18:50:05 sec so the scheduler literally adds 5 mins to end time of previous execution

Note: This should be investigated (ideally by coding a test reproducing the issue)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the cron task scheduler in the Go utility libraries and reproduce the reported five-minute schedule with a task whose execution takes time. Add a test covering the interval behavior. Done means successive runs follow the configured schedule rather than adding the previous execution duration to the next start time.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.