2022-12-17 12:44:03 +00:00
|
|
|
from uuid import uuid4
|
|
|
|
|
2024-12-25 11:40:57 +00:00
|
|
|
from pssecret.redis_db import redis
|
2022-12-17 12:44:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def get_new_key() -> str:
|
|
|
|
while True:
|
|
|
|
new_key = str(uuid4())
|
|
|
|
|
|
|
|
if not await redis.exists(new_key):
|
|
|
|
return new_key
|