Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion socs/agents/bluefors/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,13 @@ def read_and_publish_logs(self, app_session):
new = self.log_tracker.reopen_file(k)
LOG.debug("File: {f}, Line: {l}", f=k, l=new)
else:
new = v['file_object'].readline()
try:
new = v['file_object'].readline()
except OSError as e:
LOG.warn(f"Unable to read line from {k} due to error: '{e}'. "
+ "Reopening file.")
# Error likely caused by improperly closed file, so reopen it
new = self.log_tracker.reopen_file(k)
if new == '':
continue

Expand Down
Loading