mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-23 19:11:14 +01:00
57864f2be6
Generally eliminate the `while True` loops while waiting for a stop event and prefer to condition the loops on if the stop event is set, blocking on that where it makes sense. This generally comes in 3 flavors. First and simplest, when there is a sleep and the stop event is the only thing the loop blocks on, instead do a check using `stop_event.wait(timeout)` to instead block on the stop event for the designated amount of time. Second, when there is a different event that is blocking in the loop, condition the loop on `stop_event.is_set()` rather than breaking when it is set. Finally, when there is a separate internal condition that requires a counter, have the loop iterate over the counter and use `if stop_event.wait(timeout)` internal to the loop. |
||
---|---|---|
.. | ||
test | ||
__init__.py | ||
__main__.py | ||
app.py | ||
config.py | ||
const.py | ||
edgetpu.py | ||
events.py | ||
http.py | ||
log.py | ||
models.py | ||
motion.py | ||
mqtt.py | ||
object_processing.py | ||
objects.py | ||
process_clip.py | ||
record.py | ||
stats.py | ||
util.py | ||
video.py | ||
watchdog.py | ||
zeroconf.py |