Cache Username Validations #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
from functools import lru_cache
from datetime import datetime, timedelta
class UsernameCache:
def init(self, ttl_minutes: int = 60):
self.cache = {}
self.ttl = timedelta(minutes=ttl_minutes)
username_cache = UsernameCache(ttl_minutes=60)