📈 Added analytics on time spent running PoW-stuff

This commit is contained in:
Mawoka
2022-06-23 21:27:03 +02:00
parent 6e04dfc60d
commit 9756aa45af
3 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ async def upload_image(edit_id: str, pow_data: str, file: UploadFile = File()):
raise HTTPException(status_code=400, detail="Image-type now allowed!")
session_data = EditSessionData.parse_raw(session_data)
file_name = f"{session_data.quiz_id}--{uuid.uuid4()}"
# await storage.upload(file_name=file_name, file_data=file_bytes) TODO: UNCOMMENT!!!!
await storage.upload(file_name=file_name, file_data=file_bytes)
await redis.lpush(f"edit_session:{edit_id}:images", file_name)
random_str = os.urandom(8).hex()
await redis.set(f"edit_session:{edit_id}:pow", random_str, ex=3800)