From 243d2be6d40381b5bbcc7f407d5e3e5475a9e5e7 Mon Sep 17 00:00:00 2001 From: Thang PHAM Date: Wed, 30 Oct 2024 10:40:05 +0100 Subject: [PATCH] default implementation for clean method --- .../computation/service/AbstractWorkerService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/powsybl/ws/commons/computation/service/AbstractWorkerService.java b/src/main/java/com/powsybl/ws/commons/computation/service/AbstractWorkerService.java index 4dc5d49..4787ad4 100644 --- a/src/main/java/com/powsybl/ws/commons/computation/service/AbstractWorkerService.java +++ b/src/main/java/com/powsybl/ws/commons/computation/service/AbstractWorkerService.java @@ -153,18 +153,18 @@ public Consumer> consumeRun() { this.handleNonCancellationException(resultContext, e, rootReporter); } } finally { - futures.remove(resultContext.getResultUuid()); - cancelComputationRequests.remove(resultContext.getResultUuid()); - clean(resultContext.getRunContext()); + clean(resultContext); } }; } /** - * perform cleaning some data, e.g. files generated by the computation - * @param runContext The run context of the computation + * Perform cleaning + * @param resultContext The context of the computation */ - protected void clean(C runContext) { + protected void clean(AbstractResultContext resultContext) { + futures.remove(resultContext.getResultUuid()); + cancelComputationRequests.remove(resultContext.getResultUuid()); } /**