mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Better fix for serializing/deserializing cache plugins (v2)
This commit is contained in:
parent
cd6d1f9221
commit
0f1eb3cfc2
4 changed files with 17 additions and 9 deletions
8
lib/ansible/plugins/cache/memory.py
vendored
8
lib/ansible/plugins/cache/memory.py
vendored
|
@ -24,8 +24,6 @@ class CacheModule(BaseCacheModule):
|
|||
def __init__(self, *args, **kwargs):
|
||||
self._cache = {}
|
||||
|
||||
super(CacheModule, self).__init__()
|
||||
|
||||
def get(self, key):
|
||||
return self._cache.get(key)
|
||||
|
||||
|
@ -46,3 +44,9 @@ class CacheModule(BaseCacheModule):
|
|||
|
||||
def copy(self):
|
||||
return self._cache.copy()
|
||||
|
||||
def __getstate__(self):
|
||||
return self.copy()
|
||||
|
||||
def __setstate__(self, data):
|
||||
self._cache = data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue