mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-30 19:09:13 +01:00
Reset saved search stats on reindex (#14280)
This commit is contained in:
parent
ee8091ba91
commit
2897afce41
@ -3,6 +3,7 @@
|
|||||||
import base64
|
import base64
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
@ -10,7 +11,11 @@ from playhouse.shortcuts import model_to_dict
|
|||||||
|
|
||||||
from frigate.comms.inter_process import InterProcessRequestor
|
from frigate.comms.inter_process import InterProcessRequestor
|
||||||
from frigate.config.semantic_search import SemanticSearchConfig
|
from frigate.config.semantic_search import SemanticSearchConfig
|
||||||
from frigate.const import UPDATE_EMBEDDINGS_REINDEX_PROGRESS, UPDATE_MODEL_STATE
|
from frigate.const import (
|
||||||
|
CONFIG_DIR,
|
||||||
|
UPDATE_EMBEDDINGS_REINDEX_PROGRESS,
|
||||||
|
UPDATE_MODEL_STATE,
|
||||||
|
)
|
||||||
from frigate.db.sqlitevecq import SqliteVecQueueDatabase
|
from frigate.db.sqlitevecq import SqliteVecQueueDatabase
|
||||||
from frigate.models import Event
|
from frigate.models import Event
|
||||||
from frigate.types import ModelStatusTypesEnum
|
from frigate.types import ModelStatusTypesEnum
|
||||||
@ -160,6 +165,10 @@ class Embeddings:
|
|||||||
self.db.create_embeddings_tables()
|
self.db.create_embeddings_tables()
|
||||||
logger.debug("Created embeddings tables.")
|
logger.debug("Created embeddings tables.")
|
||||||
|
|
||||||
|
# Delete the saved stats file
|
||||||
|
if os.path.exists(os.path.join(CONFIG_DIR, ".search_stats.json")):
|
||||||
|
os.remove(os.path.join(CONFIG_DIR, ".search_stats.json"))
|
||||||
|
|
||||||
st = time.time()
|
st = time.time()
|
||||||
totals = {
|
totals = {
|
||||||
"thumbnails": 0,
|
"thumbnails": 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user