MCPcopy
hub / github.com/spotipy-dev/spotipy / MemoryCacheHandler

Class MemoryCacheHandler

spotipy/cache_handler.py:105–123  ·  view source on GitHub ↗

A cache handler that simply stores the token info in memory as an instance attribute of this class. The token info will be lost when this instance is freed.

Source from the content-addressed store, hash-verified

103
104
105class MemoryCacheHandler(CacheHandler):
106 """
107 A cache handler that simply stores the token info in memory as an
108 instance attribute of this class. The token info will be lost when this
109 instance is freed.
110 """
111
112 def __init__(self, token_info=None):
113 """
114 Parameters:
115 * token_info: The token info to store in memory. Can be None.
116 """
117 self.token_info = token_info
118
119 def get_cached_token(self):
120 return self.token_info
121
122 def save_token_to_cache(self, token_info):
123 self.token_info = token_info
124
125
126class DjangoSessionCacheHandler(CacheHandler):

Callers 1

test_cache_handlerMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_cache_handlerMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…