From 9c2f883a9b2ebb57d4cb7338b1b04fdf7520adb7 Mon Sep 17 00:00:00 2001 From: Mikael Salson Date: Tue, 18 Oct 2016 18:52:40 +0200 Subject: [PATCH] models/task.py: Remove temporary fused file In case of success we can remove the file in the temporary directory as it is stored elsewhere through Web2py mechanism. Storing it twice was space consuming. We modifie the log message correspondingly so that it can display the real stored file. --- server/web2py/applications/vidjil/models/task.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/web2py/applications/vidjil/models/task.py b/server/web2py/applications/vidjil/models/task.py index 6d7b8a878..3d487dedc 100755 --- a/server/web2py/applications/vidjil/models/task.py +++ b/server/web2py/applications/vidjil/models/task.py @@ -536,9 +536,12 @@ def run_fuse(id_file, id_config, id_data, sample_set_id, clean_before=True, clea p = Popen(clean_cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) p.wait() - res = {"message": "[%s] c%s: 'fuse' finished - %s" % (id_data, id_config, output_file)} + res = {"message": "[%s] c%s: 'fuse' finished - %s" % (id_data, id_config, db.fused_file[id_fuse].fused_file)} log.info(res) + # Remove temporary fused file + os.remove(output_file) + return "SUCCESS" def custom_fuse(file_list): -- GitLab