added validated_at field

This commit is contained in:
2022-09-22 22:34:05 +02:00
parent 716294caa6
commit 8bfe6719c5
+4 -1
View File
@@ -1,5 +1,6 @@
import datetime
import logging
import time
from pymongo import MongoClient
@@ -185,7 +186,9 @@ class MongoDbManager:
id = link.split("/")[-1]
collection_name = str(datetime.date.today())
collection = self.db[collection_name]
collection.find_one_and_update({'_id': id}, {"$set": {"url_validated": state}}, upsert=False)
validated_at = time.strftime("%H:%M:%S", time.localtime())
collection.find_one_and_update({'_id': id}, {"$set": {"url_validated": state, "validated_at": validated_at}},
upsert=False)
MONGO_STORE_MANAGER = MongoDbManager()