mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 08:57:35 -02:30
Merge pull request #916 from ryanpetrello/memcache-fact-cache-size-warning
make the fact caching plugin fail more gracefully for large payloads
This commit is contained in:
@@ -92,6 +92,14 @@ class CacheModule(BaseCacheModule):
|
|||||||
modified_key = self.translate_modified_key(key)
|
modified_key = self.translate_modified_key(key)
|
||||||
|
|
||||||
self.mc.set(host_key, json.dumps(value))
|
self.mc.set(host_key, json.dumps(value))
|
||||||
|
value = json.dumps(value)
|
||||||
|
rc = self.mc.set(host_key, value)
|
||||||
|
if rc == 0 and len(value) > self.mc.server_max_value_length:
|
||||||
|
self._display.error(
|
||||||
|
"memcache.set('{}', '?') failed, value > server_max_value_length ({} bytes)".format(
|
||||||
|
key, len(value)
|
||||||
|
)
|
||||||
|
)
|
||||||
self.mc.set(modified_key, datetime.datetime.now(tzutc()).isoformat())
|
self.mc.set(modified_key, datetime.datetime.now(tzutc()).isoformat())
|
||||||
|
|
||||||
def keys(self):
|
def keys(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user