mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-09 04:35:25 +03:00
Improve checking for ended recording
This commit is contained in:
parent
f72a18340c
commit
b810e1d30a
@ -7,6 +7,7 @@ import os
|
|||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
import threading
|
import threading
|
||||||
|
import time
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from multiprocessing.synchronize import Event as MpEvent
|
from multiprocessing.synchronize import Event as MpEvent
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -440,7 +441,12 @@ class RecordingMaintainer(threading.Thread):
|
|||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
# Check for new files every 5 seconds
|
# Check for new files every 5 seconds
|
||||||
wait_time = 0.0
|
wait_time = 0.0
|
||||||
while not self.stop_event.wait(wait_time):
|
while not self.stop_event.is_set():
|
||||||
|
time.sleep(wait_time)
|
||||||
|
|
||||||
|
if self.stop_event.is_set():
|
||||||
|
break
|
||||||
|
|
||||||
run_start = datetime.datetime.now().timestamp()
|
run_start = datetime.datetime.now().timestamp()
|
||||||
|
|
||||||
# check if there is an updated config
|
# check if there is an updated config
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user