Skip to content

Commit 964a46f

Browse files
Merge pull request #475 from wking/log-explainer-mid-sync
hack/log-explainer: Don't crash if run on truncated logs
2 parents 032a81f + 2589522 commit 964a46f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hack/log-explainer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ def parse_lines(lines):
9292
sync['lines'] = []
9393
sync['manifests'] = {}
9494
metadata['syncs'].append(sync)
95-
if sync:
96-
sync['lines'].append(line)
97-
else:
95+
if not sync:
9896
logging.warning('sync worker line outside of sync: {}'.format(line))
97+
continue
98+
sync['lines'].append(line)
9999
if line['message'].startswith(end_of_sync_cycle_prefix):
100100
sync['results'] = {
101101
'result': line['message'][len(end_of_sync_cycle_prefix):],

0 commit comments

Comments
 (0)