|
1 | 1 | import logging |
2 | 2 |
|
3 | 3 | from celery import Celery # type: ignore[import-untyped] |
| 4 | +from celery_library.task import register_task |
4 | 5 | from celery_library.types import register_celery_types, register_pydantic_types |
| 6 | +from models_library.functions import ( |
| 7 | + RegisteredProjectFunction, |
| 8 | + RegisteredPythonCodeFunction, |
| 9 | + RegisteredSolverFunction, |
| 10 | +) |
5 | 11 | from servicelib.logging_utils import log_context |
6 | 12 |
|
| 13 | +from ...api.dependencies.authentication import Identity |
| 14 | +from ...models.api_resources import JobLinks |
| 15 | +from ...models.schemas.jobs import JobPricingSpecification |
| 16 | +from ._functions_tasks import run_function |
| 17 | + |
7 | 18 | _logger = logging.getLogger(__name__) |
8 | 19 |
|
9 | 20 |
|
10 | 21 | def setup_worker_tasks(app: Celery) -> None: |
11 | 22 | register_celery_types() |
12 | | - register_pydantic_types() |
| 23 | + register_pydantic_types( |
| 24 | + Identity, |
| 25 | + RegisteredProjectFunction, |
| 26 | + RegisteredPythonCodeFunction, |
| 27 | + RegisteredSolverFunction, |
| 28 | + JobPricingSpecification, |
| 29 | + JobLinks, |
| 30 | + ) |
13 | 31 |
|
14 | 32 | with log_context(_logger, logging.INFO, msg="worker task registration"): |
15 | | - pass |
| 33 | + register_task(app, run_function) |
0 commit comments