Skip to content

Commit

Permalink
Clear folder on error to ensure files don't carry over to future run.
Browse files Browse the repository at this point in the history
  • Loading branch information
We-Gold committed Aug 13, 2024
1 parent 375c749 commit 93618a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/ouroboros/common/server_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ouroboros.common.logging import logger
from ouroboros.common.pipelines import backproject_pipeline, slice_pipeline
from ouroboros.common.server_types import BackProjectTask, SliceTask, Task
from ouroboros.common.volume_server_interface import clear_plugin_folder
from ouroboros.helpers.files import combine_unknown_folder


Expand Down Expand Up @@ -50,6 +51,7 @@ def handle_slice_docker(task: SliceTask):
if isinstance(load_result, str):
task.error = load_result
task.status = "error"
clear_plugin_folder()
return

slice_options, host_output_file, host_output_slices = load_result
Expand All @@ -59,6 +61,7 @@ def handle_slice_docker(task: SliceTask):
if isinstance(slice_result, str):
task.error = slice_result
task.status = "error"
clear_plugin_folder()
return

save_result = save_output_for_slice_docker(
Expand All @@ -68,6 +71,7 @@ def handle_slice_docker(task: SliceTask):
if save_result:
task.error = save_result
task.status = "error"
clear_plugin_folder()


def handle_backproject_core(task: BackProjectTask, options, slice_options):
Expand Down Expand Up @@ -111,6 +115,7 @@ def handle_backproject_docker(task: BackProjectTask):
if isinstance(load_result, str):
task.error = load_result
task.status = "error"
clear_plugin_folder()
return

(
Expand All @@ -126,6 +131,7 @@ def handle_backproject_docker(task: BackProjectTask):
if isinstance(backproject_result, str):
task.error = backproject_result
task.status = "error"
clear_plugin_folder()
return
else:
if options.make_single_file:
Expand All @@ -145,6 +151,7 @@ def handle_backproject_docker(task: BackProjectTask):
if save_result:
task.error = save_result
task.status = "error"
clear_plugin_folder()


def handle_task(task: Task):
Expand Down

0 comments on commit 93618a1

Please sign in to comment.