# HG changeset patch # User Marcin Kuzminski # Date 2020-09-03 20:44:48 # Node ID 8eb465320ee4f955f8e912a17e1a3b21070053d1 # Parent 3b004b1095e5a51ed86e8aaca207c00896e2c264 user-sessions: fix cleanup with corrupted session data. diff --git a/rhodecode/lib/user_sessions.py b/rhodecode/lib/user_sessions.py --- a/rhodecode/lib/user_sessions.py +++ b/rhodecode/lib/user_sessions.py @@ -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