hotpocket/services/backend/hotpocket_backend/apps/ui/tasks.py
Tomek Wójcik d909391ee6
Some checks failed
CI / Checks (push) Has been cancelled
Release v1.0.0rc1
2025-08-18 07:09:27 +02:00

27 lines
697 B
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
import logging
import uuid
from celery import shared_task
LOGGER = logging.getLogger(__name__)
@shared_task
def import_from_pocket(*,
account_uuid: uuid.UUID,
csv_path: str,
) -> list[tuple[uuid.UUID, uuid.UUID]]:
from hotpocket_backend.apps.ui.services import UIImportsService
try:
return UIImportsService().import_from_pocket(
account_uuid=account_uuid,
csv_path=csv_path,
)
except Exception as exception:
LOGGER.error('Unhandled exception: %s', exception, exc_info=exception)
raise exception