mail dont lock unlock since we are just reading

This commit is contained in:
Egg 2024-10-09 16:41:38 +02:00
parent 4bba1f029a
commit bbc412a104

View file

@ -28,15 +28,11 @@ class Mailbot(Bot):
logger.error("No mbox file found.")
self.mails = None
return reports
try:
self.mails.lock()
for msg in self.mails:
if user.get_city().lower() in msg['To'].lower():
if get_date_from_header(msg['Date']) > user.get_seen_mail():
reports.append(make_report(msg, user))
self.mails.unlock()
except ExternalClashError:
logger.warning("Unable to lock mbox")
for msg in self.mails:
if user.get_city().lower() in msg['To'].lower():
if get_date_from_header(msg['Date']) > user.get_seen_mail():
reports.append(make_report(msg, user))
self.mails.unlock()
return reports
# post/boost Report object