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