Skip to content

Commit

Permalink
Improve intelligibility of end_of_log determination (apache#34788)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstandish authored Oct 5, 2023
1 parent 3a8b427 commit a1a2352
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions airflow/providers/elasticsearch/log/es_task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ def _read(
# end_of_log_mark may contain characters like '\n' which is needed to
# have the log uploaded but will not be stored in elasticsearch.
metadata["end_of_log"] = False
for logs in logs_by_host.values():
if logs[-1].message == self.end_of_log_mark:
metadata["end_of_log"] = True
if any(x[-1].message == self.end_of_log_mark for x in logs_by_host.values()):
metadata["end_of_log"] = True

cur_ts = pendulum.now()
if "last_log_timestamp" in metadata:
Expand Down

0 comments on commit a1a2352

Please sign in to comment.