Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store the id of job results for easier post-job work. #887

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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