Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
22 changes: 22 additions & 0 deletions website/management/commands/run_ten_minutes.py
Original file line number Diff line number Diff line change
@@ -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
Loading