Skip to content

Commit 6b9f48f

Browse files
authored
Merge pull request #428 from chrisburr/fix-params-only
Fix only setting parameters in set_job_parameters_or_attributes
2 parents 8617bf8 + 26982ff commit 6b9f48f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,10 @@ async def set_job_parameters_or_attributes(
511511
else:
512512
param_updates[job_id][pname] = pvalue
513513

514-
# bulk set job attributes
515-
await job_db.set_job_attributes(attr_updates)
514+
# Bulk set job attributes if required
515+
attr_updates = {k: v for k, v in attr_updates.items() if v}
516+
if attr_updates:
517+
await job_db.set_job_attributes(attr_updates)
516518

517519
# TODO: can we upsert to multiple documents?
518520
for job_id, p_updates_ in param_updates.items():

0 commit comments

Comments
 (0)