Skip to content

Commit

Permalink
Merge pull request #378 from HSF/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wguanicedew authored Dec 23, 2024
2 parents f6604b1 + 203c648 commit 1eb24dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions main/lib/idds/core/processings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def add_processing(request_id, workload_id, transform_id, status, submitter=None


@read_session
def get_processing(processing_id=None, to_json=False, session=None):
def get_processing(processing_id=None, request_id=None, transform_id=None, to_json=False, session=None):
"""
Get processing or raise a NoObject exception.
Expand All @@ -77,7 +77,8 @@ def get_processing(processing_id=None, to_json=False, session=None):
:returns: Processing.
"""
return orm_processings.get_processing(processing_id=processing_id, to_json=to_json, session=session)
return orm_processings.get_processing(processing_id=processing_id, request_id=request_id,
transform_id=transform_id, to_json=to_json, session=session)


@read_session
Expand Down
7 changes: 6 additions & 1 deletion main/lib/idds/orm/processings.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def add_processing(request_id, workload_id, transform_id, status=ProcessingStatu


@read_session
def get_processing(processing_id, to_json=False, session=None):
def get_processing(processing_id, request_id=None, transform_id=None, to_json=False, session=None):
"""
Get processing or raise a NoObject exception.
Expand All @@ -128,6 +128,11 @@ def get_processing(processing_id, to_json=False, session=None):
try:
query = session.query(models.Processing)\
.filter_by(processing_id=processing_id)
if request_id is not None:
query = query.filter_by(request_id=request_id)
if transform_id is not None:
query = query.filter_by(transform_id=transform_id)

ret = query.first()
if not ret:
return None
Expand Down

0 comments on commit 1eb24dc

Please sign in to comment.