From 13fb0fb91adf7a84cf78fb5a30df5a9a10701e50 Mon Sep 17 00:00:00 2001 From: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com> Date: Fri, 18 Apr 2025 02:18:37 -0400 Subject: [PATCH] Create run_ten_minutes.py --- .../management/commands/run_ten_minutes.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 website/management/commands/run_ten_minutes.py diff --git a/website/management/commands/run_ten_minutes.py b/website/management/commands/run_ten_minutes.py new file mode 100644 index 0000000000..4a3a820572 --- /dev/null +++ b/website/management/commands/run_ten_minutes.py @@ -0,0 +1,22 @@ +import logging + +from django.core.management import call_command +from django.core.management.base import BaseCommand +from django.utils import timezone + +logger = logging.getLogger(__name__) + + +class Command(BaseCommand): + help = "Runs commands scheduled to execute 10 minutes" + + def handle(self, *args, **options): + try: + logger.info(f"Starting 10 minute scheduled tasks at {timezone.now()}") + try: + call_command("cron_send_reminders") + except Exception as e: + logger.error("Error sending user reminders", exc_info=True) + except Exception as e: + logger.error("Error in 10 minute tasks", exc_info=True) + raise