ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

How to debug a scheduled task?

Gentlemen,

has anyone experience in debugging a scheduled task in Visual Studio Code? There is nice description here (https://github.com/frappe/erpnext/wiki/VSCode-Debugging-for-Frappe-Python), but this only works for code executed under the web-process (controllers, whitelisted functions).

I even tried to execute the task from the “Scheduled Job Type” view, but breakpoints were ignored.

I can splatter the code of my scheduled task with print() and then do “bench execute”, but this is not very refined.

Is there a way to start a scheduled task in Visual Studio Code so it may be debugged?