From edf3a9634ac8f5e66b5d039447e417ecc7a9e48c Mon Sep 17 00:00:00 2001 From: Adam Welsh Date: Mon, 13 Aug 2018 13:47:13 +0100 Subject: [PATCH] [AIRFLOW-2860] DruidHook: time check is wrong --- airflow/hooks/druid_hook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airflow/hooks/druid_hook.py b/airflow/hooks/druid_hook.py index 380a3b3314b12..cafba9c6c1629 100644 --- a/airflow/hooks/druid_hook.py +++ b/airflow/hooks/druid_hook.py @@ -85,8 +85,6 @@ def submit_indexing_job(self, json_index_spec): self.log.info("Job still running for %s seconds...", sec) - sec = sec + 1 - if self.max_ingestion_time and sec > self.max_ingestion_time: # ensure that the job gets killed if the max ingestion time is exceeded requests.post("{0}/{1}/shutdown".format(url, druid_task_id)) @@ -95,6 +93,8 @@ def submit_indexing_job(self, json_index_spec): time.sleep(self.timeout) + sec = sec + self.timeout + status = req_status.json()['status']['status'] if status == 'RUNNING': running = True