mirror of
https://github.com/suitenumerique/messages.git
synced 2026-08-17 21:25:41 +02:00
🐛(selfcheck) fix warning from a race condition in thread deletion
This commit is contained in:
@@ -139,7 +139,7 @@ def deliver_inbound_message(
|
||||
channel=channel,
|
||||
)
|
||||
logger.info(
|
||||
"Queued inbound message %s for spam processing (recipient: %s)",
|
||||
"Queued inbound message %s (recipient: %s)",
|
||||
inbound_message.id,
|
||||
recipient_email,
|
||||
)
|
||||
|
||||
@@ -321,6 +321,10 @@ that the mail delivery pipeline is working correctly.</p>
|
||||
logger.error("Selfcheck failed: %s", e, exc_info=True)
|
||||
|
||||
finally:
|
||||
# Wait a bit for indexation, thread.update_stats() to be done in order
|
||||
# to avoid race conditions on deleted objects.
|
||||
time.sleep(5)
|
||||
|
||||
if message:
|
||||
_cleanup_test_data(message)
|
||||
if received_message:
|
||||
|
||||
Reference in New Issue
Block a user