Fix presigned URL generation race conditions

This commit is contained in:
2022-02-15 23:16:38 +02:00
committed by Lauri Võsandi
parent a08f1d37b7
commit 52ecba53cc
3 changed files with 20 additions and 18 deletions

View File

@@ -1,3 +1,4 @@
from datetime import datetime
from pymongo import MongoClient
from bson.objectid import ObjectId
from time import sleep
@@ -7,6 +8,14 @@ MONGO_URI="mongodb://127.0.0.1:27017/default"
db = MongoClient(MONGO_URI).get_default_database()
while True:
db.eventlog.insert_one({ "timestamp": "...", "event": "motion-detected", "started": "...", "finished": "...", "component": "motion-detect", "camera": "Server room", "action": "event",
})
db.eventlog.insert_one({
"timestamp": datetime.utcnow(),
"event": "motion-detected",
"started": "...",
"finished": "...",
"component": "motion-detect",
"camera": "Server room",
"action": "event",
"screenshot_count": 1
})
sleep(1)