Skip to content

Commit

Permalink
Fix case where S6 timestamp is missing (#12040)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Jun 18, 2024
1 parent 2cbc336 commit bdda89b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frigate/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,13 @@ def logs(service: str):
for rawLine in contents.splitlines():
cleanLine = rawLine.strip()

if len(cleanLine) < 10 or " " not in cleanLine:
if len(cleanLine) < 10:
continue

# handle cases where S6 does not include date in log line
if " " not in cleanLine:
cleanLine = f"{datetime.now()} {cleanLine}"

if dateEnd == 0:
dateEnd = cleanLine.index(" ")
keyLength = dateEnd - (6 if service_location == "frigate" else 0)
Expand Down

0 comments on commit bdda89b

Please sign in to comment.