Skip to content

Commit

Permalink
chore: Preparing some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Jul 18, 2023
1 parent 9f15124 commit d3d6727
Show file tree
Hide file tree
Showing 2 changed files with 800 additions and 799 deletions.
4 changes: 3 additions & 1 deletion nexus/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def __init__(self, context: Optional[zmq.asyncio.Context] = None, *args, **kwarg
self.scopes: tuple[str, ...] = ("identify", "guilds")

# Cache
sessionExpiry = (14 if not self.debug else 1) * 24 * 60 * 60 # 14 days if not debug, otherwise 24 hour
self.sessionData = cache.ExpiringDict(maxAgeSeconds=sessionExpiry) # auth data, containing user's keys and id
self.cachedUser = cache.ExpiringDict(maxAgeSeconds=60)
self.cachedGuilds = cache.ExpiringDict(maxAgeSeconds=60)

Expand All @@ -59,7 +61,7 @@ def __init__(self, context: Optional[zmq.asyncio.Context] = None, *args, **kwarg
SessionMiddleware,
session_cookie="user_session",
secret_key=secretKey,
max_age=None if (self.debug) else 14 * 24 * 60 * 60,
max_age=sessionExpiry,
)

self.logger = getLogger("uvicorn")
Expand Down
Loading

0 comments on commit d3d6727

Please sign in to comment.