Added another lifecycle hook with which to reset the persistent status of the parser.

This commit is contained in:
2023-12-16 07:43:31 +02:00
parent 0e916b4d70
commit 52df657af2

View File

@@ -18,6 +18,7 @@ class BaseOrderedLogParser:
line = file.readline() line = file.readline()
new_flag = False new_flag = False
break_condition = True
while (line): while (line):
# Only check for a new line if we're not at new entries yet # Only check for a new line if we're not at new entries yet
if not new_flag: if not new_flag:
@@ -34,7 +35,10 @@ class BaseOrderedLogParser:
self.aggregators_deinit(file, aggregates, status) self.aggregators_deinit(file, aggregates, status)
self.update_status(aggregates, status) if not break_condition:
self.reset_status(aggregates, status)
else:
self.update_status(aggregates, status)
def get_context_manager(self): def get_context_manager(self):
""" """
@@ -52,6 +56,12 @@ class BaseOrderedLogParser:
""" """
pass pass
def reset_status(self, aggregates, status):
"""
Resets the saved status of the parser.
"""
pass
def update_status(self, aggregates, status): def update_status(self, aggregates, status):
""" """
Updates the saved status of the parser. Updates the saved status of the parser.