mail dont lock unlock since we are just reading
This commit is contained in:
parent
4bba1f029a
commit
bbc412a104
|
@ -28,15 +28,11 @@ class Mailbot(Bot):
|
||||||
logger.error("No mbox file found.")
|
logger.error("No mbox file found.")
|
||||||
self.mails = None
|
self.mails = None
|
||||||
return reports
|
return reports
|
||||||
try:
|
for msg in self.mails:
|
||||||
self.mails.lock()
|
if user.get_city().lower() in msg['To'].lower():
|
||||||
for msg in self.mails:
|
if get_date_from_header(msg['Date']) > user.get_seen_mail():
|
||||||
if user.get_city().lower() in msg['To'].lower():
|
reports.append(make_report(msg, user))
|
||||||
if get_date_from_header(msg['Date']) > user.get_seen_mail():
|
self.mails.unlock()
|
||||||
reports.append(make_report(msg, user))
|
|
||||||
self.mails.unlock()
|
|
||||||
except ExternalClashError:
|
|
||||||
logger.warning("Unable to lock mbox")
|
|
||||||
return reports
|
return reports
|
||||||
|
|
||||||
# post/boost Report object
|
# post/boost Report object
|
||||||
|
|
Loading…
Reference in a new issue