kaxil commented on a change in pull request #8266: Fix non updating DAG code by 
checking against last modification time
URL: https://github.com/apache/airflow/pull/8266#discussion_r407435121
 
 

 ##########
 File path: airflow/models/dagcode.py
 ##########
 @@ -124,15 +124,14 @@ def bulk_sync_to_db(cls, filelocs: Iterable[str], 
session=None):
             session.add(orm_dag_code)
 
         for fileloc in existing_filelocs:
-            old_version = existing_orm_dag_codes_by_fileloc_hashes[
-                filelocs_to_hashes[fileloc]
-            ]
-            file_modified = datetime.fromtimestamp(
-                os.path.getmtime(correct_maybe_zipped(fileloc)), 
tz=timezone.utc)
+            current_version = 
existing_orm_dag_codes_by_fileloc_hashes[filelocs_to_hashes[fileloc]]
+            file_mod_time = datetime.fromtimestamp(
+                os.path.getmtime(correct_maybe_zipped(fileloc)), 
tz=timezone.utc
+            )
 
-            if (file_modified - timedelta(seconds=120)) > 
old_version.last_updated:
 
 Review comment:
   You will have to remove `timedelta` from the import statement at the top of 
the file. Pylint was failing with "import not used" 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to