Scheduler via hooks


Im trying to create a scheduler event that runs every hour (set to “All” for testing).

Ived created the methos in my doctype python file and referenced it in my hooks file of the app as

scheduler_events = {
“all”: [

I dont think it running cause the data its meant to update has not changed. How can I tell if it actually running and how and where can I create logs so I can put some debug info?

Ived searched the forums and tried ‘bench doctor’ and get this:

bench --site kyalom doctor
-----Checking scheduler status-----
Workers online: 3
-----None Jobs-----

Any other reasons and tricks I can apply to get this to work? Am I missing something?

im on version: Frappe Framework: v8.9.2 (master)


Hi @hpema108,

Try sudo supervisorctl restart all :wink:

To test your method, use the bench execute command, so you can debug it without running it as a scheduled event.

Hi @chdecultot

Thanks for your input…already tried the : sudo supervisorctl restart all, that did not work but the reason was my reference to where the script was located which I found by using the bench execute command.

Thanks that solved it for me :wink:


Hi @chdecultot

Interesting thing happening. When i try bench execute the script runs. But it does not seem to run on the scheduler which for now I set to “all” so that would be 3 mins no? Or do I have to set that somewhere too?

I checking in the frappe.log file when it runs as I used frappe.logger().debug(‘Checking Expired pins…’)

Any more ideas?


Humm… Difficult to say. If you have restarted all supervisor processes after changing the path to your command, I really don’t know.

Have you checked bench doctor ?

same as before:

hemant@ubuntu:~/frappe-bench$ bench --site kyalom doctor
-----Checking scheduler status-----
Workers online: 3
-----None Jobs-----

Hi @chdecultot,

This issue solved. I had to wait at least 3 mins for the first run of scheduler to run.

All fine and working perfectly. Please close this topic as solved. Thanks.


1 Like