template-backend/src/application/management/commands/run_task.py
2025-02-11 20:43:52 +03:00

14 lines
307 B
Python

import time
from django.core.management import BaseCommand
from rq.job import Job
from application.tasks.example import example_task
class Command(BaseCommand):
def handle(self, *args, **options):
task: Job = example_task.delay(1, 1)
time.sleep(1)
print(task.return_value())