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