Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mailer/management/commands/runmailer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import sys
from argparse import ArgumentParser
from contextlib import suppress
from datetime import datetime

from django.core.management import BaseCommand
Expand All @@ -27,4 +28,5 @@ def handle(self, *args, **options):
self.stdout.write("Starting django-mailer send loop.")
quit_command = "CTRL-BREAK" if sys.platform == "win32" else "CONTROL-C"
self.stdout.write(f"Quit the loop with {quit_command}.")
send_loop()
with suppress(KeyboardInterrupt):
send_loop()
4 changes: 3 additions & 1 deletion src/mailer/management/commands/runmailer_pg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import sys
from argparse import ArgumentParser
from contextlib import suppress
from datetime import datetime

from django.core.management import BaseCommand
Expand Down Expand Up @@ -28,4 +29,5 @@ def handle(self, *args, **options):
self.stdout.write("Starting django-mailer send loop.")
quit_command = "CTRL-BREAK" if sys.platform == "win32" else "CONTROL-C"
self.stdout.write(f"Quit the loop with {quit_command}.")
postgres_send_loop()
with suppress(KeyboardInterrupt):
postgres_send_loop()
Loading