瀏覽代碼

[fix] if supervisor is restarting, do not queue the jobs (#4112)

* [fix] if supervisor is restarting, do not queue the jobs

* Update scheduler.py
version-14
Saurabh 7 年之前
committed by Makarand Bauskar
父節點
當前提交
cb46380e64
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. +6
    -0
      frappe/utils/scheduler.py

+ 6
- 0
frappe/utils/scheduler.py 查看文件

@@ -16,6 +16,7 @@ import schedule
import time
import MySQLdb
import frappe.utils
import os
from frappe.utils import get_sites
from datetime import datetime
from frappe.utils.background_jobs import enqueue, get_jobs, queue_timeout
@@ -40,6 +41,11 @@ def start_scheduler():

def enqueue_events_for_all_sites():
'''Loop through sites and enqueue events that are not already queued'''

if os.path.exists(os.path.join('.', '.restarting')):
# Don't add task to queue if webserver is in restart mode
return

with frappe.init_site():
jobs_per_site = get_jobs()
sites = get_sites()


Loading…
取消
儲存