Skip to content

Commit

Permalink
assume the clip for the event exists with recordings
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Aug 12, 2021
1 parent 9cab5da commit b33f4e2
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions frigate/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@ def should_create_clip(self, camera, event_data):

return True

def verify_clip(self, camera, end_time):
# check every 5 seconds for the last required recording
for _ in range(4):
recordings_count = (
Recordings.select()
.where(Recordings.camera == camera, Recordings.end_time > end_time)
.limit(1)
.count()
)
if recordings_count > 0:
return True
logger.debug(f"Missing recording for {camera} clip. Waiting...")
time.sleep(5)

logger.warning(
f"Unable to verify clip for {camera}. There were no recordings for this camera."
)
return False

def run(self):
while not self.stop_event.is_set():
try:
Expand All @@ -99,13 +80,6 @@ def run(self):

has_clip = self.should_create_clip(camera, event_data)

# Wait for recordings to be ready
if has_clip:
has_clip = self.verify_clip(
camera,
event_data["end_time"] + record_config.events.post_capture,
)

if has_clip or event_data["has_snapshot"]:
Event.create(
id=event_data["id"],
Expand Down

0 comments on commit b33f4e2

Please sign in to comment.