Reset DB items in app

This commit is contained in:
Nicolas Mowen 2024-04-10 09:36:59 -06:00
parent 728b6cdb6a
commit 5ac79a7a4b
2 changed files with 8 additions and 4 deletions

View File

@ -667,6 +667,14 @@ class FrigateApp:
logger.info("Stopping...")
self.stop_event.set()
# set an end_time on entries without an end_time before exiting
Event.update(end_time=datetime.datetime.now().timestamp()).where(
Event.end_time == None
).execute()
ReviewSegment.update(end_time=datetime.datetime.now().timestamp()).where(
ReviewSegment.end_time == None
).execute()
# Stop Communicators
self.inter_process_communicator.stop()
self.inter_config_updater.stop()

View File

@ -112,10 +112,6 @@ class EventProcessor(threading.Thread):
self.handle_external_detection(event_type, event_data)
# set an end_time on events without an end_time before exiting
Event.update(end_time=datetime.datetime.now().timestamp()).where(
Event.end_time == None
).execute()
self.event_receiver.stop()
self.event_end_publisher.stop()
logger.info("Exiting event processor...")