mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-11 00:20:56 +08:00
More work on fix for #424 - TypeError: can't pickle _thread.lock objects.
AWS and Mongo brockers should be pickeled correctly now.
This commit is contained in:
@@ -19,6 +19,10 @@ class Mongo(Broker):
|
||||
super(Mongo, self).__init__(list_key)
|
||||
self.collection = self.get_collection()
|
||||
|
||||
def __setstate__(self, state):
|
||||
super(Mongo, self).__setstate__(state)
|
||||
self.collection = self.get_collection()
|
||||
|
||||
@staticmethod
|
||||
def get_connection(list_key: str = Conf.PREFIX) -> MongoClient:
|
||||
return MongoClient(**Conf.MONGO)
|
||||
|
||||
Reference in New Issue
Block a user