|
2 | 2 | # SPDX-License-Identifier: Apache-2.0 |
3 | 3 | import asyncio |
4 | 4 | from datetime import datetime |
5 | | -from typing import Annotated |
6 | 5 |
|
7 | 6 | from asgi_correlation_id import correlation_id |
8 | 7 | from fastapi import APIRouter, Depends, Query |
9 | 8 | from jinja2 import Template |
10 | 9 | from kombu.exceptions import KombuError |
11 | 10 |
|
12 | | -from syncmaster.backend.dependencies import Stub |
13 | 11 | from syncmaster.backend.services import UnitOfWork, get_user |
14 | 12 | from syncmaster.db.models import RunType, Status, User |
15 | 13 | from syncmaster.db.utils import Permission |
|
23 | 21 | ReadRunSchema, |
24 | 22 | RunPageSchema, |
25 | 23 | ) |
26 | | -from syncmaster.settings import Settings |
27 | 24 | from syncmaster.worker.config import celery |
| 25 | +from syncmaster.worker.settings import worker_settings |
28 | 26 |
|
29 | 27 | router = APIRouter(tags=["Runs"], responses=get_error_responses()) |
30 | 28 |
|
@@ -83,7 +81,6 @@ async def read_run( |
83 | 81 | @router.post("/runs") |
84 | 82 | async def start_run( |
85 | 83 | create_run_data: CreateRunSchema, |
86 | | - settings: Annotated[Settings, Depends(Stub(Settings))], |
87 | 84 | unit_of_work: UnitOfWork = Depends(UnitOfWork), |
88 | 85 | current_user: User = Depends(get_user(is_active=True)), |
89 | 86 | ) -> ReadRunSchema: |
@@ -120,7 +117,7 @@ async def start_run( |
120 | 117 | type=RunType.MANUAL, |
121 | 118 | ) |
122 | 119 |
|
123 | | - log_url = Template(settings.worker.LOG_URL_TEMPLATE).render( |
| 120 | + log_url = Template(worker_settings.LOG_URL_TEMPLATE).render( |
124 | 121 | run=run, |
125 | 122 | correlation_id=correlation_id.get(), |
126 | 123 | ) |
|
0 commit comments