Skip to content
Merged
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
3 changes: 2 additions & 1 deletion backend/donations/management/commands/schedule_ngos_check.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from datetime import timedelta
from random import randint

from django.utils import timezone
from django_q.models import Schedule
Expand All @@ -18,7 +19,7 @@ class Command(SchedulerCommand):
"schedule_type": Schedule.MINUTES,
"minutes": 12,
"repeats": -1,
"next_run": timezone.now() + timedelta(minutes=0),
"next_run": timezone.now() + timedelta(seconds=randint(0, 8 * 60)),
}

def handle(self, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from datetime import timedelta
from random import randint

from django.utils import timezone
from django_q.models import Schedule
Expand All @@ -20,7 +21,7 @@ class Command(SchedulerCommand):
"schedule_type": Schedule.MINUTES,
"minutes": 15,
"repeats": -1,
"next_run": timezone.now() + timedelta(minutes=0),
"next_run": timezone.now() + timedelta(seconds=randint(0, 10 * 60)),
}

choices = [StatsChoices.NGOS_REGISTERED, StatsChoices.NGOS_ACTIVE, StatsChoices.NGOS_WITH_NGOHUB]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from datetime import timedelta
from random import randint

from django.utils import timezone
from django_q.models import Schedule
Expand All @@ -20,7 +21,7 @@ class Command(SchedulerCommand):
"schedule_type": Schedule.MINUTES,
"minutes": 15,
"repeats": -1,
"next_run": timezone.now() + timedelta(minutes=0),
"next_run": timezone.now() + timedelta(seconds=randint(0, 10 * 60)),
}

choices = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from datetime import timedelta
from random import randint

from django.utils import timezone
from django_q.models import Schedule
Expand All @@ -19,5 +20,5 @@ class Command(SchedulerCommand):
"schedule_type": Schedule.MINUTES,
"minutes": 5,
"repeats": -1,
"next_run": timezone.now() + timedelta(minutes=0),
"next_run": timezone.now() + timedelta(seconds=randint(0, 3 * 60)),
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
from datetime import timedelta

from django.utils import timezone
from django_q.models import Schedule

from utils.common.commands import SchedulerCommand
Expand All @@ -8,12 +10,13 @@


class Command(SchedulerCommand):
help = "Schedule a session cleanup task to run every day at 5:30 AM."
help = "Schedule a session cleanup task to run once a day"

command_name: str = "clearsessions"

schedule_name = "CLEANUP_SESSIONS"
schedule_details = {
"schedule_type": Schedule.DAILY,
"repeats": -1,
"next_run": timezone.now() + timedelta(minutes=40),
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ class Command(SchedulerCommand):
schedule_details = {
"schedule_type": Schedule.DAILY,
"repeats": -1,
"next_run": timezone.now() + timedelta(minutes=7),
"next_run": timezone.now() + timedelta(minutes=50),
}
Loading