mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix case where S6 timestamp is missing (#12040)
This commit is contained in:
parent
2cbc336bc0
commit
bdda89b5e2
@ -481,9 +481,13 @@ def logs(service: str):
|
|||||||
for rawLine in contents.splitlines():
|
for rawLine in contents.splitlines():
|
||||||
cleanLine = rawLine.strip()
|
cleanLine = rawLine.strip()
|
||||||
|
|
||||||
if len(cleanLine) < 10 or " " not in cleanLine:
|
if len(cleanLine) < 10:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# handle cases where S6 does not include date in log line
|
||||||
|
if " " not in cleanLine:
|
||||||
|
cleanLine = f"{datetime.now()} {cleanLine}"
|
||||||
|
|
||||||
if dateEnd == 0:
|
if dateEnd == 0:
|
||||||
dateEnd = cleanLine.index(" ")
|
dateEnd = cleanLine.index(" ")
|
||||||
keyLength = dateEnd - (6 if service_location == "frigate" else 0)
|
keyLength = dateEnd - (6 if service_location == "frigate" else 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user