Bench scheduled tasks not running

I have scheduled tasks as following:

scheduler_events = {
    "cron": {
        "*/15 * * * *": [
            "custom_app.tasks.poll_api",
       ]
    }
}

I have already ran bench enable-scheduler but the tasks arent running.

When I run bench doctor, this is the output:

-----Checking scheduler status-----
Workers online: 3
-----site1.local Jobs-----

What could be the issue here

@revant_one Can you assist?

Hi @redgren

Better late than never…

Since you’re defining a “Standard” Scheduled Job on the FS, not a “Custom” Scheduled Job in the WUI, you have to synchronise the modifications in hooks.py with the DB. To do so, you have to run

bench migrate

It will not create a Scheduled Job Type record as for a “Custom” Scheduled Job, however it will make the necessary entry in cron.

After running bench migrate, your jobs should run.

1 Like