Set cache pickle protocol to 2.

HIGHEST_PROTOCOL will cause it to change when we move from python 2 to 3
and this may cause issues as older machines try to read objects pickeld
with a version of the protocol they don't know.

During deploys, and if we have to roll back are two examples.
This commit is contained in:
Feanil Patel
2019-10-17 16:51:57 -04:00
parent 14f9b5dd35
commit 29cc071edd

View File

@@ -151,7 +151,7 @@ class process_cached(object): # pylint: disable=invalid-name
def zpickle(data):
"""Given any data structure, returns a zlib compressed pickled serialization."""
return zlib.compress(pickle.dumps(data, pickle.HIGHEST_PROTOCOL))
return zlib.compress(pickle.dumps(data, 2)) # Keep this constant as we upgrade from python 2 to 3.
def zunpickle(zdata):