Commit 9ff0982e authored by Ryan Herbert's avatar Ryan Herbert

file.py task.py a some fuse failsafes.

If there are no files in the left in the sample_set don't request a
refuse.
Also add failsafe in the fuse, if for some reason a fuse is requested
but no results_files exist in the queries, don't run fuse and fail the
task

See #3621
parent da20ed7d
Pipeline #49511 passed with stages
in 13 minutes and 16 seconds
......@@ -451,7 +451,9 @@ def delete():
config_ids = get_sequence_file_config_ids(request.vars["id"])
db(db.results_file.sequence_file_id == request.vars["id"]).delete()
db(db.sequence_file.id == request.vars["id"]).delete()
schedule_fuse(sample_set_ids, config_ids)
set_memberships = db(db.sample_set_membership.sample_set_id.belongs(sample_set_ids)).select()
non_empty_set_ids = [r.sample_set_id for r in set_memberships]
schedule_fuse(non_empty_set_ids, config_ids)
res = {"redirect": "sample_set/index",
"args" : { "id" : request.vars["redirect_sample_set_id"]},
......
......@@ -646,6 +646,12 @@ def run_fuse(id_file, id_config, id_data, sample_set_id, clean_before=True, clea
files += defs.DIR_RESULTS + row.results_file.data_file + " "
sequence_file_list += str(row.results_file.sequence_file_id) + "_"
if files == "":
print("!!! Fuse failed: no files to fuse")
res = {"message": "[%s] c%s: 'fuse' FAILED - %s no files to fuse" % (id_data, id_config, output_file)}
log.error(res)
return "FAILED"
try:
fuse_cmd = db.config[id_config].fuse_command
cmd = "python "+defs.DIR_FUSE+"/fuse.py -o "+ output_file + " " + fuse_cmd + " " + files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment