[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crontab jobs are rescheduled many times with the default value repeat=None #317

Open
newmancu opened this issue Nov 21, 2024 · 0 comments
Open

Comments

@newmancu
Copy link
newmancu commented Nov 21, 2024

This code will example will create a cron job that starts at 02:00 AM, but after successful completion the job will be recreated again until it becomes 02:01.

from rq_scheduler import Scheduler
sc = Scheduler()
sc.cron(
        "0 2 * * *", 
        do_something_very_fast,
        use_local_timezone=True,
        result_ttl=3600 * 23,
    )

Suggestion:

Add an example of this behavior into the cron method or make repeat=0.

Quick fix suggestion:

from rq_scheduler import Scheduler
sc = Scheduler()
sc.cron(
        "0 2 * * *", 
        do_something_very_fast,
        use_local_timezone=True,
        result_ttl=3600 * 23,
        repeat=0,
    )
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

No branches or pull requests

1 participant