modified
scheduler/management/commands/scheduler.py
@@ -16,11 +16,10 @@ class Command(BaseCommand): if task.should_run(): now = timezone.now() timestamp = now.strftime('%d/%b/%Y %H:%M:%S %z') print(timestamp) self.stdout.write(f'[Scheduler] [{timestamp}] Running task {task.management_command}') call_command(task.management_command) task.last_run_at = now task.next_run_at = task.get_next_run_at(now) task.save() time.sleep(5) time.sleep(60) self.stdout.write('[Scheduler] Sleeping scheduler for 60 seconds...')