timetoconfirm
Raz 7 months ago
parent 9f20bae167
commit 4d671af2bf
  1. 3
      tournaments/management/commands/schedule_tasks.py

@ -2,14 +2,13 @@ from django.core.management.base import BaseCommand
from tournaments.tasks import check_confirmation_deadlines
from django.utils import timezone
import datetime
import pytz
from background_task.models import Task
class Command(BaseCommand):
help = 'Schedule background tasks to run at :00 and :30 of every hour'
def handle(self, *args, **options):
# Clear existing tasks first to avoid duplicates
from background_task.models import Task
Task.objects.filter(task_name='tournaments.tasks.check_confirmation_deadlines').delete()
# Get the current timezone-aware time

Loading…
Cancel
Save