fat-catTW commented on code in PR #72869:
URL: https://github.com/apache/airflow/pull/72869#discussion_r3990506153
##########
airflow-core/src/airflow/utils/log/file_processor_handler.py:
##########
@@ -65,9 +64,9 @@ def set_context(self, filename):
self.handler.setFormatter(self.formatter)
self.handler.setLevel(self.level)
- if self._cur_date < datetime.today():
+ if self._cur_date < timezone.utcnow().date():
Review Comment:
LGTM! Thanks for the fix!!
Just one nit: Could we capture `timezone.utcnow().date()` once here and
reuse it for both the comparison and `_cur_date` assignment? That avoids
calling it twice and makes it clear both operations use the same date value.
```python
current_date = timezone.utcnow().date()
if self._cur_date < current_date:
self._symlink_latest_log_directory()
self._cur_date = current_date
--
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]