optimization on mail_reader_all_contacts.py

This commit is contained in:
Lei PAN
2025-12-01 17:14:56 +01:00
parent a689e66635
commit 0cf94d44fc
4 changed files with 291 additions and 161 deletions
+4 -1
View File
@@ -83,7 +83,8 @@ class MongoDbManager:
result_list.append(ContactPojo.from_firestore_dict(document))
return result_list
def save_links_to_validate(self, link: str, mail_address: str, model: str, _all_contact_list: list):
def save_links_to_validate(self, link: str, mail_address: str, model: str,
_all_contact_list: list, _used_ip: str = ""):
collection_to_use = self.db[LINKS_TO_VALIDATE]
updated_at = time.strftime("%H:%M:%S", time.localtime())
_ip_country = "FR"
@@ -100,6 +101,7 @@ class MongoDbManager:
u'serial': serial,
u'model': model,
u'ip_country': _ip_country,
u'_used_ip': _used_ip,
"updated_at": updated_at
},
upsert=True)
@@ -109,6 +111,7 @@ class MongoDbManager:
u'serial': serial,
u'model': model,
u'ip_country': _ip_country,
u'_used_ip': _used_ip,
"updated_at": updated_at
},
upsert=True)