Skip to content

Commit 8e01a7b

Browse files
author
Jaap Roes
committed
Minor optimization to the database query in send_loop
1 parent 9be9e11 commit 8e01a7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mailer/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def send_loop():
267267
"""
268268

269269
while True:
270-
while not Message.objects.all():
270+
while not Message.objects.all().exists():
271271
logger.debug("sleeping for %s seconds before checking queue again" % EMPTY_QUEUE_SLEEP)
272272
time.sleep(EMPTY_QUEUE_SLEEP)
273273
send_all()

0 commit comments

Comments
 (0)