Cleanup after recordings refactor

This commit is contained in:
Nicolas Mowen 2024-09-03 07:07:52 -06:00
parent 21a50cc452
commit 14c82f8119
2 changed files with 2 additions and 7 deletions

View File

@ -57,11 +57,7 @@ class ExternalEventProcessor:
thumbnail = self._write_images( thumbnail = self._write_images(
camera_config, label, event_id, draw, snapshot_frame camera_config, label, event_id, draw, snapshot_frame
) )
end = ( end = now + duration if duration is not None else None
now + duration + camera_config.record.events.post_capture
if duration is not None
else None
)
self.event_sender.publish( self.event_sender.publish(
( (
@ -74,7 +70,7 @@ class ExternalEventProcessor:
"sub_label": sub_label, "sub_label": sub_label,
"score": score, "score": score,
"camera": camera, "camera": camera,
"start_time": now - camera_config.record.events.pre_capture, "start_time": now,
"end_time": end, "end_time": end,
"thumbnail": thumbnail, "thumbnail": thumbnail,
"has_clip": camera_config.record.enabled and include_recording, "has_clip": camera_config.record.enabled and include_recording,

View File

@ -89,7 +89,6 @@ class RecordingCleanup(threading.Thread):
max_deletes = 100000 max_deletes = 100000
deleted_reviews_list = list(map(lambda x: x[0], expired_reviews)) deleted_reviews_list = list(map(lambda x: x[0], expired_reviews))
logger.info(f"the list is {deleted_reviews_list}")
for i in range(0, len(deleted_reviews_list), max_deletes): for i in range(0, len(deleted_reviews_list), max_deletes):
ReviewSegment.delete().where( ReviewSegment.delete().where(
ReviewSegment.id << deleted_reviews_list[i : i + max_deletes] ReviewSegment.id << deleted_reviews_list[i : i + max_deletes]