Skip to content

Commit

Permalink
Merge branch 'main' into jorism/add-observations
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMaskedTurtle authored Dec 6, 2023
2 parents e78dd0a + e666d07 commit 902c509
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.function.Consumer;

import static org.gridsuite.loadflow.server.service.LoadFlowRunContext.buildParameters;
import static org.gridsuite.loadflow.server.service.NotificationService.CANCEL_MESSAGE;
import static org.gridsuite.loadflow.server.service.NotificationService.FAIL_MESSAGE;

/**
Expand Down Expand Up @@ -153,6 +154,7 @@ private void saveLoadflowResult(Network network, LoadFlowResultContext resultCon
private void cleanLoadFlowResultsAndPublishCancel(UUID resultUuid, String receiver) {
resultRepository.delete(resultUuid);
notificationService.publishStop(resultUuid, receiver);
LOGGER.info(CANCEL_MESSAGE + " (resultUuid='{}')", resultUuid);
}

private static LoadingLimits.TemporaryLimit getBranchLimitViolationAboveCurrentValue(Branch<?> branch, LimitViolationInfos violationInfo) {
Expand Down Expand Up @@ -280,8 +282,8 @@ public Consumer<Message<String>> consumeRun() {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (Exception e) {
LOGGER.error(FAIL_MESSAGE, e);
if (!(e instanceof CancellationException)) {
LOGGER.error(FAIL_MESSAGE, e);
notificationService.publishFail(resultContext.getResultUuid(), resultContext.getRunContext().getReceiver(), e.getMessage(), resultContext.getRunContext().getUserId());
resultRepository.delete(resultContext.getResultUuid());
}
Expand Down

0 comments on commit 902c509

Please sign in to comment.