mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-21 16:08:12 +08:00
Sets pickle protocol to highest
* package signing protocol is now set to highest. Tests show this to be about a 35% speed increase and there is increased probability of correctly pickling complex objects. * also upped the protocol on the result database picklefield.
This commit is contained in:
+3
-3
@@ -16,9 +16,9 @@ class Task(models.Model):
|
||||
name = models.CharField(max_length=100, editable=False)
|
||||
func = models.CharField(max_length=256)
|
||||
hook = models.CharField(max_length=256, null=True)
|
||||
args = PickledObjectField(null=True)
|
||||
kwargs = PickledObjectField(null=True)
|
||||
result = PickledObjectField(null=True)
|
||||
args = PickledObjectField(null=True, protocol=-1)
|
||||
kwargs = PickledObjectField(null=True, protocol=-1)
|
||||
result = PickledObjectField(null=True, protocol=-1)
|
||||
group = models.CharField(max_length=100, editable=False, null=True)
|
||||
started = models.DateTimeField(editable=False)
|
||||
stopped = models.DateTimeField(editable=False)
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ class PickleSerializer(object):
|
||||
|
||||
@staticmethod
|
||||
def dumps(obj):
|
||||
return pickle.dumps(obj)
|
||||
return pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
|
||||
@staticmethod
|
||||
def loads(data):
|
||||
|
||||
Reference in New Issue
Block a user