jedcunningham commented on code in PR #60864:
URL: https://github.com/apache/airflow/pull/60864#discussion_r2713653263


##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -989,8 +990,28 @@ def _add_new_files_to_queue(self, known_files: dict[str, 
set[DagFileInfo]]):
 
     def _resort_file_queue(self):
         if self._file_parsing_sort_mode == "modified_time" and 
self._file_queue:
-            files, _ = self._sort_by_mtime(self._file_queue)
-            self._file_queue = deque(files)
+            files_with_mtime: dict[DagFileInfo, float] = {}
+            mtime_changed = False
+
+            for file in list(self._file_queue):
+                try:
+                    mtime = os.path.getmtime(file.absolute_path)
+                    files_with_mtime[file] = mtime
+                    stat = self._file_stats[file]

Review Comment:
   ```suggestion
                       stat = self._file_stats.get(file)
   ```
   
   It may not be in _file_stats yet if its a new file, but that's okay. Not 
sure what it'd do with the sorting below though.



-- 
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