Zkplo commented on code in PR #11568:
URL: https://github.com/apache/inlong/pull/11568#discussion_r1865331335


##########
inlong-manager/manager-schedule/src/test/resources/airflow/dag_cleaner.py:
##########
@@ -29,33 +29,47 @@
 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"
-    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:
+    current_time = utc_time.strftime("%Y-%m-%d %H:%M:%S.%f")
+
+    conf = context.get('dag_run').conf
+    groupId = conf.get('inlong_group_id')
+
+    logging.info(f"Execution parameters for this cleaning task: {conf}")
+    logging.info(f"The execution time of this cleaning task is: {current_time} 
for groupId = {groupId}")

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]

Reply via email to