Skip to content

Commit 048d0fb

Browse files
committed
fix: tmp
1 parent 3b06149 commit 048d0fb

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

diracx-logic/src/diracx/logic/jobs/query.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,7 @@ async def summary(
103103
"value": preferred_username,
104104
}
105105
)
106+
print(f"Summary search: {body.search}")
107+
print(f"Summary grouping: {body.grouping}")
108+
print(f"Preferred username: {preferred_username}")
106109
return await job_db.summary(body.grouping, body.search)

diracx-logic/src/diracx/logic/jobs/status.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ async def set_job_parameters_or_attributes(
524524
# Those dicts create a mapping of job_id -> {attribute_name: value}
525525
attr_updates: dict[int, dict[str, Any]] = {}
526526
param_updates: dict[int, dict[str, Any]] = {}
527+
print("METADATA", updates)
527528

528529
for job_id, metadata in updates.items():
529530
attr_updates[job_id] = {}
@@ -554,6 +555,9 @@ async def set_job_parameters_or_attributes(
554555
# Bulk set job parameters if required
555556
await _insert_parameters(param_updates, job_parameters_db, job_db)
556557

558+
print("PARAMETERS", param_updates)
559+
print("ATTRIBUTES", attr_updates)
560+
557561

558562
async def add_heartbeat(
559563
data: dict[int, HeartbeatData],

diracx-routers/src/diracx/routers/jobs/status.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from http import HTTPStatus
55
from typing import Annotated, Any
66

7-
from fastapi import Body, HTTPException, Query
7+
from fastapi import Body, HTTPException, Query, Request
88

99
from diracx.core.models import (
1010
HeartbeatData,
@@ -264,6 +264,7 @@ async def reschedule_jobs(
264264

265265
@router.patch("/metadata", status_code=HTTPStatus.NO_CONTENT)
266266
async def patch_metadata(
267+
request: Request,
267268
updates: Annotated[dict[int, JobMetaData], Body(openapi_examples=EXAMPLE_METADATA)],
268269
job_db: JobDB,
269270
job_parameters_db: JobParametersDB,
@@ -272,6 +273,8 @@ async def patch_metadata(
272273
"""Update job metadata such as UserPriority, HeartBeatTime, JobType, etc.
273274
The argument are all the attributes/parameters of a job (except the ID).
274275
"""
276+
# display raw request body for debugging
277+
print(f"RAW REQUEST BODY {await request.body()}")
275278
await check_permissions(action=ActionType.MANAGE, job_db=job_db, job_ids=updates)
276279
try:
277280
await set_job_parameters_or_attributes_bl(updates, job_db, job_parameters_db)

0 commit comments

Comments
 (0)