fix: 批量执行接口用例报错

This commit is contained in:
chenjianxing 2021-03-24 10:30:11 +08:00
parent 44f289f752
commit 0d297aada9
1 changed files with 2 additions and 1 deletions

View File

@ -22,7 +22,8 @@ public class ScriptEngineUtils {
} }
} }
public static String calculate(String input) { // graal.js 禁止多线程同时访问加上 synchronized
public synchronized static String calculate(String input) {
try { try {
return engine.eval("calculate('" + input + "')").toString(); return engine.eval("calculate('" + input + "')").toString();
} catch (ScriptException e) { } catch (ScriptException e) {