Skip to content

Commit

Permalink
fix(job-manager): use Config object from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Jun 18, 2024
1 parent 0dace05 commit 57c9231
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions diracx-routers/src/diracx/routers/job_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from sqlalchemy.exc import NoResultFound
from typing_extensions import TypedDict

from diracx.core.config import Config, ConfigSource
from diracx.core.exceptions import JobNotFound
from diracx.core.models import (
JobStatus,
Expand All @@ -30,7 +29,7 @@
set_job_status,
)

from ..dependencies import JobDB, JobLoggingDB, SandboxMetadataDB, TaskQueueDB
from ..dependencies import Config, JobDB, JobLoggingDB, SandboxMetadataDB, TaskQueueDB
from ..fastapi_classes import DiracxRouter
from ..utils.users import AuthorizedUserInfo, verify_dirac_access_token
from .access_policies import ActionType, CheckWMSPolicyCallable
Expand Down Expand Up @@ -234,7 +233,7 @@ def __init__(self, user_info: AuthorizedUserInfo, allInfo: bool = True):
@router.delete("/")
async def delete_bulk_jobs(
job_ids: Annotated[list[int], Query()],
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
job_logging_db: JobLoggingDB,
task_queue_db: TaskQueueDB,
Expand Down Expand Up @@ -272,7 +271,7 @@ async def delete_bulk_jobs(
@router.post("/kill")
async def kill_bulk_jobs(
job_ids: Annotated[list[int], Query()],
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
job_logging_db: JobLoggingDB,
task_queue_db: TaskQueueDB,
Expand Down Expand Up @@ -308,7 +307,7 @@ async def kill_bulk_jobs(
@router.post("/remove")
async def remove_bulk_jobs(
job_ids: Annotated[list[int], Query()],
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
job_logging_db: JobLoggingDB,
sandbox_metadata_db: SandboxMetadataDB,
Expand Down Expand Up @@ -565,7 +564,7 @@ async def reschedule_single_job(

@router.post("/search", responses=EXAMPLE_RESPONSES)
async def search(
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
user_info: Annotated[AuthorizedUserInfo, Depends(verify_dirac_access_token)],
check_permissions: CheckWMSPolicyCallable,
Expand Down Expand Up @@ -627,7 +626,7 @@ async def search(

@router.post("/summary")
async def summary(
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
user_info: Annotated[AuthorizedUserInfo, Depends(verify_dirac_access_token)],
body: JobSummaryParams,
Expand Down Expand Up @@ -660,7 +659,7 @@ async def get_single_job(
@router.delete("/{job_id}")
async def delete_single_job(
job_id: int,
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
job_logging_db: JobLoggingDB,
task_queue_db: TaskQueueDB,
Expand Down Expand Up @@ -691,7 +690,7 @@ async def delete_single_job(
@router.post("/{job_id}/kill")
async def kill_single_job(
job_id: int,
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
job_logging_db: JobLoggingDB,
task_queue_db: TaskQueueDB,
Expand All @@ -718,7 +717,7 @@ async def kill_single_job(
@router.post("/{job_id}/remove")
async def remove_single_job(
job_id: int,
config: Annotated[Config, Depends(ConfigSource.create)],
config: Config,
job_db: JobDB,
job_logging_db: JobLoggingDB,
sandbox_metadata_db: SandboxMetadataDB,
Expand Down

0 comments on commit 57c9231

Please sign in to comment.