Skip to content

Conversation

WhySoBad
Copy link
Contributor

Hi,
I noticed that you updated the cron package on the 0.4.0-beta version. Unlike the old cron package robfig/cron/v1 does the new cron package robfig/cron/v3 no longer support seconds in the format.

I've also added logs to all instances where new jobs are created since the error produced was not logged anywhere.

closes #351

c.sh.AddJob(j)
err = c.sh.AddJob(j)
if err != nil {
c.logger.Debugf("Unable to add new exec job %s from config: %v", name, err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... the error was supposed to be logged inside AddJob function. Let me try to reproduce this

@@ -52,7 +52,7 @@ command = touch /tmp/example


[job-service-run "service-executed-on-new-container"]
schedule = 0,20,40 * * * *
schedule = 0,20,40 * * *
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This schedule actually had 5 elements, as expected

Suggested change
schedule = 0,20,40 * * *
schedule = 0,20,40 * * * *

### INI-file example

```ini
[job-service-run "service-executed-on-new-container"]
schedule = 0,20,40 * * * *
schedule = 0,20,40 * * *
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
schedule = 0,20,40 * * *
schedule = 0,20,40 * * * *

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it might make sense to implement some kind of detection of wrong cron format and discard last * for backward compatibility.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably make sense to do this:

Screenshot 2025-07-20 at 16 57 141

Footnotes

  1. https://github.com/robfig/cron?tab=readme-ov-file#upgrading-to-v3-june-2019

@taraspos
Copy link
Collaborator

Superseded by #366

@taraspos taraspos closed this Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version 0.4.0-beta can not register jobs any longer
2 participants