Commit Graph

29 Commits

Author SHA1 Message Date
Blake Blackshear
7bf7365f6c better log message when corrupt segment detected 2021-10-02 06:58:29 -05:00
Blake Blackshear
5a8016de87 simplify logic and fix wrong segments expiring (fixes #1779) 2021-09-17 17:15:16 -05:00
Blake Blackshear
bc350644bd make expiration of deleted camera footage faster 2021-09-17 17:12:03 -05:00
Blake Blackshear
6c28613def moar speed 2021-09-03 06:31:06 -05:00
Blake Blackshear
56480dc1ef bulk delete recordings 2021-09-02 20:40:38 -05:00
Blake Blackshear
8e1c15291d optimize checking recordings for events
sorts events and recordings so you can avoid a cartesian product of checking all events against all recordings
2021-09-02 08:24:53 -05:00
Blake Blackshear
a1e52c51b1 dont expire events in two places 2021-09-01 07:06:52 -05:00
Blake Blackshear
8cc834633e reduce db queries for recording cleanup 2021-09-01 06:44:05 -05:00
Blake Blackshear
7d65c05994 properly handle scenario with no recordings 2021-08-30 06:58:50 -05:00
Blake Blackshear
6ccff71408 handle missing camera names 2021-08-28 07:43:51 -05:00
Blake Blackshear
29de723267 limit legacy expiration to files after the oldest recording in the db 2021-08-24 06:50:58 -05:00
Blake Blackshear
26424488a5 use find to reduce CPU usage for legacy expiration 2021-08-23 07:21:27 -05:00
Blake Blackshear
334095252c copy then delete (fixes #1516) 2021-08-17 06:52:15 -05:00
Blake Blackshear
9cab5da74c cleanup dynamic mp4 clips 2021-08-11 07:39:03 -05:00
Blake Blackshear
189b9c6648 use a nginx internal redirect 2021-08-11 06:22:26 -05:00
Jason Hunter
181a504a14 break out recording maintenance and cleanup into separate threads 2021-08-07 15:51:16 -05:00
Jason Hunter
5d940bcb86 optimize recording maintenance logic 2021-08-07 15:51:16 -05:00
Jason Hunter
5d94c68d66 fix recording retention logic 2021-08-07 15:51:16 -05:00
Jason Hunter
a476bc9885 initial commit 2021-08-07 15:51:16 -05:00
Jason Hunter
055bd22138 initial implementation of recordings table 2021-06-10 07:04:28 -05:00
Sean Vig
57864f2be6 Wait on stop event when possible
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.
2021-05-22 07:54:16 -05:00
Sean Vig
a4e6d9ed9a Improve ffprobe executions
When running ffprobe, use `subprocess.run` rather than
`subprocess.Popen`.  This simplifies the handling that is needed to run
and process the outputs.  Here, filename parsing is also simplified by
explicitly removing the file extension with `os.path.splitext` and
forcing a single split into the camera name and the formatted date.
2021-05-22 07:48:00 -05:00
Blake Blackshear
39ff49e054 formatting cleanup 2021-02-25 07:01:57 -06:00
Blake Blackshear
840f046572 handle process exit exceptions 2021-01-26 21:40:33 -06:00
kluszczyn
b0b2d9d972 Recordings - fix expire_file 2021-01-26 21:40:33 -06:00
Blake Blackshear
c787c8948e dont delete the recordings directory 2021-01-26 21:40:33 -06:00
Blake Blackshear
735cc3962b make directories constants 2021-01-26 21:40:33 -06:00
Blake Blackshear
feb42181de cleanup empty directories 2021-01-26 21:40:33 -06:00
Blake Blackshear
65ddd91855 add recording maintenance 2021-01-26 21:40:33 -06:00