🐛(selfcheck) fix warning from a race condition in thread deletion

This commit is contained in:
Sylvain Zimmer
2025-12-18 15:03:01 +01:00
parent cb2ac356cc
commit 6558bf88a7
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -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,
)
+4
View File
@@ -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: