mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-04 13:47:37 +02:00
Catch json decode exception when semantic search stats file is corrupted
This commit is contained in:
parent
4f4c8a4fb9
commit
e51b3dd51e
@ -7,6 +7,7 @@ import multiprocessing as mp
|
|||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import threading
|
import threading
|
||||||
|
from json.decoder import JSONDecodeError
|
||||||
from types import FrameType
|
from types import FrameType
|
||||||
from typing import Any, Optional, Union
|
from typing import Any, Optional, Union
|
||||||
|
|
||||||
@ -78,7 +79,7 @@ class EmbeddingsContext:
|
|||||||
data = json.loads(f.read())
|
data = json.loads(f.read())
|
||||||
self.thumb_stats.from_dict(data["thumb_stats"])
|
self.thumb_stats.from_dict(data["thumb_stats"])
|
||||||
self.desc_stats.from_dict(data["desc_stats"])
|
self.desc_stats.from_dict(data["desc_stats"])
|
||||||
except FileNotFoundError:
|
except (FileNotFoundError, JSONDecodeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user