Create /upload_token endpoint
This commit is contained in:
+3
-1
@@ -17,15 +17,17 @@ class RedisWorker:
|
||||
)
|
||||
self.files_ttl = int(os.getenv('FILES_TTL'))
|
||||
|
||||
def create_record(self, user_ip: str, file_name: str, file_uuid: str, file_type: str, add_date):
|
||||
def create_record(self, user_ip: str, file_name: str, file_uuid: str, file_type: str, add_date:str, file_size:int):
|
||||
self.client.hset(file_uuid, mapping={
|
||||
"file_name": file_name,
|
||||
"file_size": file_size,
|
||||
"user_ip": user_ip,
|
||||
"file_type": file_type,
|
||||
"add_date": add_date
|
||||
})
|
||||
self.client.expire(file_uuid, self.files_ttl)
|
||||
|
||||
|
||||
def get_record(self, file_uuid:str):
|
||||
return self.client.hgetall(file_uuid)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user