Skip to content

Commit

Permalink
Restore execution environment before the execution complete notificat…
Browse files Browse the repository at this point in the history
  • Loading branch information
4e6 authored Oct 5, 2023
1 parent 5a1aaed commit f135637
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ class ExecuteJob(
executionEnvironment.foreach(env =>
context.setExecutionEnvironment(ExecutionEnvironment.forName(env.name))
)
val outcome = ProgramExecutionSupport.runProgram(contextId, stack)
val outcome =
try ProgramExecutionSupport.runProgram(contextId, stack)
finally {
originalExecutionEnvironment.foreach(context.setExecutionEnvironment)
}
outcome match {
case Some(diagnostic: Api.ExecutionResult.Diagnostic) =>
if (diagnostic.isError) {
Expand Down Expand Up @@ -74,7 +78,6 @@ class ExecuteJob(
)
)
} finally {
originalExecutionEnvironment.foreach(context.setExecutionEnvironment)
ctx.locking.releaseReadCompilationLock()
logger.log(
Level.FINEST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.PrintStream;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;

import org.enso.compiler.Compiler;
import org.enso.compiler.context.InlineContext;
Expand Down

0 comments on commit f135637

Please sign in to comment.