Zkplo commented on code in PR #11568:
URL: https://github.com/apache/inlong/pull/11568#discussion_r1865122777
##########
inlong-manager/manager-schedule/src/test/resources/airflow/dag_creator.py:
##########
@@ -98,7 +96,7 @@ def taskFunction(**context):
print("Request Body: ", data)
response = requests.post(url, params=params, headers=headers, json=data)
if response.status_code == 200:
- print(response.json())
+ print(response.json()) # Assuming to return JSON data
Review Comment:
sure. done.
##########
inlong-manager/manager-schedule/src/test/resources/airflow/dag_cleaner.py:
##########
@@ -29,33 +29,46 @@
from airflow import configuration
DAG_PATH = configuration.get('core', 'dags_folder') + "/"
-
+DAG_PREFIX = 'inlong_offline_task_'
def clean_expired_dags(**context):
+
original_time = context.get('execution_date')
target_timezone = pytz.timezone("Asia/Shanghai")
utc_time = original_time.astimezone(target_timezone)
- current_time = utc_time.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
+ current_time = utc_time.strftime("%Y-%m-%d %H:%M:%S.%f")
logging.info(f"Current time: {current_time}")
- for dag_file in os.listdir(DAG_PATH):
- if dag_file.endswith(".py") and
dag_file.startswith("inlong_offline_task_"):
- with open(DAG_PATH + dag_file, "r") as file:
- line = file.readline()
- while line and "end_offset_datetime_str" not in line:
+
+ conf = context.get('dag_run').conf
+ logging.info(f"conf: {conf}")
Review Comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]