You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2023/06/28 04:04:38 UTC
[superset] branch john-bodley--fix-celery-eta created (now f5c4fa1fe8)
This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a change to branch john-bodley--fix-celery-eta
in repository https://gitbox.apache.org/repos/asf/superset.git
at f5c4fa1fe8 fix: Use Celery task ETA for alert/report schedule
This branch includes the following new commits:
new f5c4fa1fe8 fix: Use Celery task ETA for alert/report schedule
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[superset] 01/01: fix: Use Celery task ETA for alert/report schedule
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch john-bodley--fix-celery-eta
in repository https://gitbox.apache.org/repos/asf/superset.git
commit f5c4fa1fe8695526488d111698334c75e9becb3c
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Tue Jun 27 21:04:32 2023 -0700
fix: Use Celery task ETA for alert/report schedule
---
superset/tasks/scheduler.py | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/superset/tasks/scheduler.py b/superset/tasks/scheduler.py
index 7e0422b001..fecd6629f4 100644
--- a/superset/tasks/scheduler.py
+++ b/superset/tasks/scheduler.py
@@ -64,21 +64,15 @@ def scheduler() -> None:
active_schedule.working_timeout
+ app.config["ALERT_REPORTS_WORKING_SOFT_TIME_OUT_LAG"]
)
- execute.apply_async(
- (
- active_schedule.id,
- schedule,
- ),
- **async_options,
- )
+ execute.apply_async((active_schedule.id,), **async_options)
@celery_app.task(name="reports.execute", bind=True)
-def execute(self: Celery.task, report_schedule_id: int, scheduled_dttm: str) -> None:
+def execute(self: Celery.task, report_schedule_id: int) -> None:
task_id = None
try:
task_id = execute.request.id
- scheduled_dttm_ = parser.parse(scheduled_dttm)
+ scheduled_dttm = execute.request.eta
logger.info(
"Executing alert/report, task id: %s, scheduled_dttm: %s",
task_id,
@@ -87,7 +81,7 @@ def execute(self: Celery.task, report_schedule_id: int, scheduled_dttm: str) ->
AsyncExecuteReportScheduleCommand(
task_id,
report_schedule_id,
- scheduled_dttm_,
+ scheduled_dttm,
).run()
except ReportScheduleUnexpectedError:
logger.exception(