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)
  • Loading branch information
sjmiller609 authored and kaxil committed Oct 30, 2019
1 parent 744f2b7 commit 87f2abb
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 @@ -141,10 +141,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 87f2abb

Please sign in to comment.