user-sessions: fix cleanup with corrupted session data.
This commit is contained in:
parent
9430615145
commit
d79287cbfe
1 changed files with 4 additions and 1 deletions
|
|
@ -224,7 +224,10 @@ class RedisAuthSessions(BaseAuthSessions):
|
|||
data = client.get(key)
|
||||
if data:
|
||||
json_data = pickle.loads(data)
|
||||
accessed_time = json_data['_accessed_time']
|
||||
try:
|
||||
accessed_time = json_data['_accessed_time']
|
||||
except KeyError:
|
||||
accessed_time = 0
|
||||
if accessed_time < expiry_time:
|
||||
client.delete(key)
|
||||
deleted_keys += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue