From 123191b0f47a90ca7dd27e5bf2072e4886ca5b33 Mon Sep 17 00:00:00 2001 From: Daniel Hladek Date: Fri, 17 Mar 2023 16:40:55 +0100 Subject: [PATCH] zz --- mongo/mongocwarler.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mongo/mongocwarler.py b/mongo/mongocwarler.py index 299c01f..27f7a2f 100644 --- a/mongo/mongocwarler.py +++ b/mongo/mongocwarler.py @@ -23,6 +23,18 @@ MINFILESIZE=300 MAXFILESIZE=10000000 MINTEXTSIZE=200 +def put_queue(db,channel,message): + queuecol = db["queue"] + queuecol.insert_one({"channel":channel,"message":message,"created_at":datetime.utcnow(),"started_at":None}) + +def reserve_queue(db,channel,message): + queuecol = db["queue"] + r = queuecol.find_one_and_delete({"channel":channel},sort={"created_at":-1}) + +def delete_queue(db,channel): + queuecol = db["queue"] + pass + def calculate_checksums(text): """ @return fingerprints of a paragraphs in text. Paragraphs are separated by a blank line