8000 Crontab jobs are rescheduled many times with the default value repeat=None · Issue #317 · rq/rq-scheduler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Crontab jobs are rescheduled many times with the default value repeat=None #317
Open
@newmancu

Description

@newmancu

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,
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0