diff --git a/worker-dev/app.py b/worker-dev/app.py index 7f3652e..46e97b8 100644 --- a/worker-dev/app.py +++ b/worker-dev/app.py @@ -97,12 +97,12 @@ def main(): res["status"] = "RECALL_FALSE" - t = coll.update_one({ - "client": res["client"], + t = coll.update_many({ + "client": {'$regex': res["client"]}, "status": {'$in': ["NOT_ANSWERED", "RECALL_FALSE"]} }, {'$set': res, '$inc': {"count_try": 1}}) - coll.update_many({"count_try": {"$gt": 2}}, {"$set": {"status": "DELETED"}}) + coll.update_many({"count_try": {"$gt": 2}, "client": res["client"]}, {"$set": {"status": "DELETED"}}) # ------------------------------- res.clear()