Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Edge Case Running Status of Sandbox #205

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ protected void runScript(Script script){
}

public <T> T runClosure(Closure<T> closure, Object... args) {
startRunning();
if (!isRunning()) startRunning();
T result = null;
try {
result = closure.call(args);
} catch (Exception e) {
GroovyScript.LOGGER.error("Caught an exception trying to run a closure:");
e.printStackTrace();
} finally {
stopRunning();
if (!isRunning()) stopRunning();
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void load() throws Exception {
@ApiStatus.Internal
@Override
public <T> T runClosure(Closure<T> closure, Object... args) {
startRunning();
if (!isRunning()) startRunning();
T result = null;
try {
result = runClosureInternal(closure, args);
Expand All @@ -189,7 +189,7 @@ public <T> T runClosure(Closure<T> closure, Object... args) {
return new AtomicInteger();
}).addAndGet(1);
} finally {
stopRunning();
if (!isRunning()) stopRunning();
IntegerLimit marked this conversation as resolved.
Show resolved Hide resolved
}
return result;
}
Expand Down