mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 14:48:11 +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)
|
name = models.CharField(max_length=100, editable=False)
|
||||||
func = models.CharField(max_length=256)
|
func = models.CharField(max_length=256)
|
||||||
hook = models.CharField(max_length=256, null=True)
|
hook = models.CharField(max_length=256, null=True)
|
||||||
args = PickledObjectField(null=True)
|
args = PickledObjectField(null=True, protocol=-1)
|
||||||
kwargs = PickledObjectField(null=True)
|
kwargs = PickledObjectField(null=True, protocol=-1)
|
||||||
result = PickledObjectField(null=True)
|
result = PickledObjectField(null=True, protocol=-1)
|
||||||
group = models.CharField(max_length=100, editable=False, null=True)
|
group = models.CharField(max_length=100, editable=False, null=True)
|
||||||
started = models.DateTimeField(editable=False)
|
started = models.DateTimeField(editable=False)
|
||||||
stopped = models.DateTimeField(editable=False)
|
stopped = models.DateTimeField(editable=False)
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ class PickleSerializer(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def dumps(obj):
|
def dumps(obj):
|
||||||
return pickle.dumps(obj)
|
return pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def loads(data):
|
def loads(data):
|
||||||
|
|||||||
Reference in New Issue
Block a user