mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix job files API for case when nginx upload not being used.
Fixes regressions introduced with PR #110.
This commit is contained in:
@@ -342,7 +342,7 @@ class PulsarJobRunner( AsynchronousJobRunner ):
|
||||
|
||||
encoded_job_id = self.app.security.encode_id(job_id)
|
||||
job_key = self.app.security.encode_id( job_id, kind="jobs_files" )
|
||||
endpoint_base = "%s/api/jobs/%s?job_key=%s"
|
||||
endpoint_base = "%s/api/jobs/%s/files?job_key=%s"
|
||||
if self.app.config.nginx_upload_job_files_path:
|
||||
endpoint_base = "%s" + \
|
||||
self.app.config.nginx_upload_job_files_path + \
|
||||
|
||||
@@ -99,7 +99,12 @@ class JobFilesAPIController( BaseAPIController ):
|
||||
try:
|
||||
shutil.move( input_file.name, path )
|
||||
finally:
|
||||
input_file.close()
|
||||
try:
|
||||
input_file.close()
|
||||
except OSError:
|
||||
# Fails to close file if not using nginx upload because the
|
||||
# tempfile has moved and Python wants to delete it.
|
||||
pass
|
||||
return {"message": "ok"}
|
||||
|
||||
def __authorize_job_access(self, trans, encoded_job_id, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user