-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
The use of find_and_modify means only one Job is recovered from stale lock.
The same query + update expressions work with the PyMongo function update_many which updates all documents that match.
it = q.collection.update_many({"locked_by": {"$ne": None}, "locked_at": { "$lt": datetime.now() - timedelta(0.125)}},{"$set": {"locked_by": None, "locked_at": None},"$inc": {"attempts": 1}})
Metadata
Metadata
Assignees
Labels
No labels