from typing import Any

from django.core.management.base import BaseCommand

from core.tasks import update_products_task


class Command(BaseCommand):
    def handle(self, *args: list[Any], **options: dict[Any, Any]) -> None:
        self.stdout.write(self.style.SUCCESS("Starting fetching products task in worker container..."))

        update_products_task.delay()  # type: ignore [attr-defined]

        self.stdout.write(self.style.SUCCESS("Started fetching products task in worker container without errors!"))
