Skip to content

Commit

Permalink
Fix logs downloading for tasks (apache#63)
Browse files Browse the repository at this point in the history
(cherry picked from commit e979162)
(cherry picked from commit 87f2abb)
(cherry picked from commit 06f19c9)
(cherry picked from commit 1b52c3a)
  • Loading branch information
sjmiller609 authored and kaxil committed Jul 13, 2020
1 parent 2d15077 commit e44d171
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions airflow/utils/log/es_task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def _read(self, ti, try_number, metadata=None):
if 'last_log_timestamp' in metadata:
last_log_ts = timezone.parse(metadata['last_log_timestamp'])
if cur_ts.diff(last_log_ts).in_minutes() >= 5 or 'max_offset' in metadata \
and offset >= metadata['max_offset']:
and int(offset) >= int(metadata['max_offset']):
metadata['end_of_log'] = True

if offset != next_offset or 'last_log_timestamp' not in metadata:
if int(offset) != int(next_offset) or 'last_log_timestamp' not in metadata:
metadata['last_log_timestamp'] = str(cur_ts)

# If we hit the end of the log, remove the actual end_of_log message
Expand Down

0 comments on commit e44d171

Please sign in to comment.