from uuid import uuid4 from pssecret.redis_db import redis async def get_new_key() -> str: while True: new_key = str(uuid4()) if not await redis.exists(new_key): return new_key