Unable Edit Timing for Email Pull

By default, the email retrieval occurs every 10 minutes, indicated by the cron format setting. However, there is currently no option available to modify the timing.

Hi @Prasath_Sekar:

This behavior is editable on your hooks.py file.

scheduler_events = {
	"cron": {
		"0/15 * * * *": [
			"frappe.oauth.delete_oauth2_data",
			"frappe.website.doctype.web_page.web_page.check_publish_status",
			"frappe.twofactor.delete_all_barcodes_for_users",
		],
		"0/10 * * * *": [
			"frappe.email.doctype.email_account.email_account.pull",
		],
	},
	"all": [
		"frappe.email.queue.flush",

Hope this helps.

I have made the necessary changes in the hooks.py file and used the following command to restart:

bench restart

However, the changes have not been reflected yet.

Is it still running each 10 minutes? Or is not running?

  • Use bench doctor to check if scheduler is running. And ‘bench scheduler enable’ or bench scheduler disable to start and stop it, and bench scheduler pause and bench scheduler resume to pause/restart jobs …

  • Check if other app’s hooks file contains this cron job with other timing. Hook’s order resolution can be changed on “Installed apps” doctype

  • Check jobs logs

Hope this helps.

it is running each 10 minutes

Is there any way i can update the timing in the site itself ?

image

Hi @Prasath_Sekar :

Need to run

bench --yoursite migrate

This will update jobs schedule config from hooks.
Hope this helps.

This doesn’t works. I tried this command

sudo bench --yoursite migrate

WARN: You should not run this command as root

Hi:

Please, replace--yoursite with the name of your site xD. e.g. If your site is prasath.com try

bench --site prasath.com migrate

Hope this helps.