mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-12 17:10:45 +00:00
Simplify check for existing token (#765)
* Simplify check for existing token in RedisCacheHandler * Update CHANGELOG.md
This commit is contained in:
1 parent
08411b9031
commit
9a627e88f4
2 files changed
+4
-2
No files matched your search
@@ -166,8 +166,9 @@ class RedisCacheHandler(CacheHandler):
|
||||
def get_cached_token(self):
|
||||
token_info = None
|
||||
try:
|
||||
if self.redis.exists(self.key):
|
||||
token_info = json.loads(self.redis.get(self.key))
|
||||
token_info = self.redis.get(self.key)
|
||||
if token_info:
|
||||
return json.loads(token_info)
|
||||
except RedisError as e:
|
||||
logger.warning('Error getting token from cache: ' + str(e))
|
||||
|
||||
|
||||
Reference in new issue
Block a user