Skip to content

Commit

Permalink
Merge pull request #887 from girder/store-job-results
Browse files Browse the repository at this point in the history
Store the id of job results for easier post-job work.
  • Loading branch information
manthey authored Jul 8, 2022
2 parents 401f64b + b37f865 commit 58eb379
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Pass options to the annotationLayer mode ([881](../../pull/881))
- Support more style range options ([883](../../pull/883))
- When converting girder images locally, prefer mount paths ([886](../../pull/886))
- Store the id of job results for easier post-job work ([887](../../pull/887))

### Changes
- Be more consistent in source class name attribute assignment ([884](../../pull/884))
Expand Down
7 changes: 6 additions & 1 deletion utilities/tasks/large_image_tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,19 @@ def convert_image_job(job):
)
job = Job().updateJob(job, log='Storing result\n')
with open(dest, 'rb') as fobj:
Upload().uploadFromFile(
fileObj = Upload().uploadFromFile(
fobj,
size=os.path.getsize(dest),
name=name or os.path.basename(dest),
parentType='folder',
parent=folder,
user=user,
)
job = Job().load(job['_id'], force=True)
job.setdefault('results', {})
job['results'].setdefault('file', [])
job['results']['file'].append(fileObj['_id'])
job = Job().save(job)
except Exception as exc:
status = JobStatus.ERROR
logger.exception('Failed in large image conversion')
Expand Down

0 comments on commit 58eb379

Please sign in to comment.