|
2 | 2 | import logging |
3 | 3 | import socket |
4 | 4 | import sys |
5 | | -from typing import Callable, Dict, List, Any, Optional, Tuple |
| 5 | +from typing import Any, Callable, Dict, List, Optional, Tuple |
6 | 6 | from uuid import UUID |
7 | 7 |
|
8 | 8 | import streamcapture |
9 | 9 | from billiard.einfo import ExceptionInfo |
10 | | -from celery import Task as CeleryTask, Celery |
| 10 | +from celery import Celery |
| 11 | +from celery import Task as CeleryTask |
11 | 12 | from celery.apps.worker import Worker as CeleryWorker |
12 | | -from kombu import Queue as KombuQueue |
13 | 13 | from esdl import EnergySystem |
| 14 | +from kombu import Queue as KombuQueue |
| 15 | +from omotes_sdk_protocol.internal.task_pb2 import TaskProgressUpdate, TaskResult |
14 | 16 |
|
15 | | -from omotes_sdk.internal.orchestrator_worker_events.esdl_messages import EsdlMessage |
| 17 | +from omotes_sdk.internal.common.broker_interface import BrokerInterface |
16 | 18 | from omotes_sdk.internal.common.esdl_util import pyesdl_from_string |
| 19 | +from omotes_sdk.internal.orchestrator_worker_events.esdl_messages import EsdlMessage |
17 | 20 | from omotes_sdk.internal.worker.configs import WorkerConfig |
18 | | -from omotes_sdk.internal.common.broker_interface import BrokerInterface |
19 | | -from omotes_sdk_protocol.internal.task_pb2 import ( |
20 | | - TaskResult, |
21 | | - TaskProgressUpdate, |
22 | | -) |
23 | 21 | from omotes_sdk.types import ProtobufDict |
24 | 22 |
|
25 | 23 | logger = logging.getLogger("omotes_sdk_internal") |
@@ -323,7 +321,13 @@ def start(self) -> None: |
323 | 321 | queues = [] |
324 | 322 | for worker_task_type in WORKER_TASK_TYPES: |
325 | 323 | logger.info("Starting Worker to work on task %s", worker_task_type) |
326 | | - queues.append(KombuQueue(worker_task_type, routing_key=worker_task_type, queue_arguments={"x-max-priority": 10})) |
| 324 | + queues.append( |
| 325 | + KombuQueue( |
| 326 | + worker_task_type, |
| 327 | + routing_key=worker_task_type, |
| 328 | + queue_arguments={"x-max-priority": 10}, |
| 329 | + ) |
| 330 | + ) |
327 | 331 | self.celery_app.task( |
328 | 332 | wrapped_worker_task, base=WorkerTask, name=worker_task_type, bind=True |
329 | 333 | ) |
|
0 commit comments