ソースを参照

Merge branch 'hotfix'

version-14
Nabin Hait 7年前
コミット
143032065c
2個のファイルの変更16行の追加25行の削除
  1. +1
    -1
      frappe/__init__.py
  2. +15
    -24
      frappe/email/doctype/email_account/email_account.py

+ 1
- 1
frappe/__init__.py ファイルの表示

@@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template

__version__ = '9.0.9'
__version__ = '9.0.10'
__title__ = "Frappe Framework"

local = Local()


+ 15
- 24
frappe/email/doctype/email_account/email_account.py ファイルの表示

@@ -685,36 +685,27 @@ def pull(now=False):
frappe.cache().set_value("workers:no-internet", False)
else:
return

queued_jobs = get_jobs(site=frappe.local.site, key='job_name')[frappe.local.site]
email_accounts = frappe.db.sql_list("""select name from `tabEmail Account` where
enable_incoming=1 and awaiting_password=0""")

# No incoming email account available
if not email_accounts:
return
for email_account in frappe.get_list("Email Account",
filters={"enable_incoming": 1, "awaiting_password": 0}):
if now:
pull_from_email_account(email_account.name)

if now:
pull_from_email_accounts(email_accounts)
else:
# job_name is used to prevent duplicates in queue
job_name = 'pull_from_email_accounts|{0}'.format(",".join(email_accounts))
else:
# job_name is used to prevent duplicates in queue
job_name = 'pull_from_email_account|{0}'.format(email_account.name)

if job_name not in queued_jobs:
enqueue(pull_from_email_accounts, 'short', event='all', job_name=job_name,
email_accounts=email_accounts)
if job_name not in queued_jobs:
enqueue(pull_from_email_account, 'short', event='all', job_name=job_name,
email_account=email_account.name)

def pull_from_email_accounts(email_accounts):
def pull_from_email_account(email_account):
'''Runs within a worker process'''
if not email_accounts:
return

for email_account in email_accounts:
email_account = frappe.get_doc("Email Account", email_account)
email_account.receive()
email_account = frappe.get_doc("Email Account", email_account)
email_account.receive()

# mark Email Flag Queue mail as read
email_account.mark_emails_as_read_unread()
# mark Email Flag Queue mail as read
email_account.mark_emails_as_read_unread()

def get_max_email_uid(email_account):
# get maximum uid of emails


読み込み中…
キャンセル
保存