summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-10-11 15:15:13 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-10-11 15:15:13 +0300
commit741727bc2228bfe24deb62bb3e6041211bec37eb (patch)
tree70068653501cbd649e1d870946c9992893ba2a34 /src
parent8a9f5261904face76f45949fa06a53bd6b3882fb (diff)
ipcam_server: add http endpoint for manually triggering cleanup job
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ipcam_server.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ipcam_server.py b/src/ipcam_server.py
index 0e88a56..79b4c54 100755
--- a/src/ipcam_server.py
+++ b/src/ipcam_server.py
@@ -134,6 +134,7 @@ class IPCamWebServer(http.HTTPServer):
self.post('/api/debug/migrate-mtimes', self.debug_migrate_mtimes)
self.post('/api/debug/fix', self.debug_fix)
+ self.post('/api/debug/cleanup', self.debug_cleanup)
self.post('/api/timestamp/{name}/{type}', self.set_timestamp)
self.post('/api/motion/done/{name}', self.submit_motion)
@@ -218,6 +219,10 @@ class IPCamWebServer(http.HTTPServer):
asyncio.ensure_future(fix_job())
return self.ok()
+ async def debug_cleanup(self, req: http.Request):
+ asyncio.ensure_future(cleanup_job())
+ return self.ok()
+
async def set_timestamp(self, req: http.Request):
cam, time_type, time = self._getset_timestamp_params(req, need_time=True)
db.set_timestamp(cam, time_type, time)