mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
Add config for celery email task soft time (#8887)
This commit is contained in:
committed by
Ville Brofeldt
parent
6537d5ed8c
commit
478e445a5a
@@ -651,6 +651,10 @@ SCHEDULED_EMAIL_DEBUG_MODE = False
|
||||
# Email reports - minimum time resolution (in minutes) for the crontab
|
||||
EMAIL_REPORTS_CRON_RESOLUTION = 15
|
||||
|
||||
# The MAX duration (in seconds) a email schedule can run for before being killed
|
||||
# by celery.
|
||||
EMAIL_ASYNC_TIME_LIMIT_SEC = 300
|
||||
|
||||
# Email report configuration
|
||||
# From address in emails
|
||||
EMAIL_REPORT_FROM_ADDRESS = "reports@superset.org"
|
||||
|
||||
@@ -346,7 +346,11 @@ def deliver_slice(schedule):
|
||||
_deliver_email(schedule, subject, email)
|
||||
|
||||
|
||||
@celery_app.task(name="email_reports.send", bind=True, soft_time_limit=300)
|
||||
@celery_app.task(
|
||||
name="email_reports.send",
|
||||
bind=True,
|
||||
soft_time_limit=config["EMAIL_ASYNC_TIME_LIMIT_SEC"],
|
||||
)
|
||||
def schedule_email_report(
|
||||
task, report_type, schedule_id, recipients=None
|
||||
): # pylint: disable=unused-argument
|
||||
|
||||
Reference in New Issue
Block a user