fix: don't reset has_snapshot on in-progress events during shutdown

The shutdown cleanup query sets end_time on all events that are still
in progress, but it also unconditionally sets has_snapshot=False. This
clobbers the snapshot status for events that already received their
snapshot but haven't ended yet.

The ReviewSegment cleanup right below correctly only updates end_time
without touching other fields.
This commit is contained in:
ryzendigo 2026-03-17 16:19:12 +08:00
parent 722ef6a1fe
commit 4f4b472c81

View File

@ -606,9 +606,9 @@ class FrigateApp:
self.stop_event.set()
# set an end_time on entries without an end_time before exiting
Event.update(
end_time=datetime.datetime.now().timestamp(), has_snapshot=False
).where(Event.end_time == None).execute()
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()