MCPcopy
hub / github.com/django/django / aload

Method aload

django/contrib/sessions/backends/cached_db.py:53–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51 return data
52
53 async def aload(self):
54 try:
55 data = await self._cache.aget(await self.acache_key())
56 except Exception:
57 # Some backends (e.g. memcache) raise an exception on invalid
58 # cache keys. If this happens, reset the session. See #17810.
59 data = None
60
61 if data is None:
62 s = await self._aget_session_from_db()
63 if s:
64 data = self.decode(s.session_data)
65 await self._cache.aset(
66 await self.acache_key(),
67 data,
68 await self.aget_expiry_age(expiry=s.expire_date),
69 )
70 else:
71 data = {}
72 return data
73
74 def exists(self, session_key):
75 return (

Callers

nothing calls this directly

Calls 6

acache_keyMethod · 0.95
_aget_session_from_dbMethod · 0.95
aget_expiry_ageMethod · 0.80
agetMethod · 0.45
decodeMethod · 0.45
asetMethod · 0.45

Tested by

no test coverage detected