diff --git a/application/src/main/java/org/thingsboard/server/service/script/RemoteJsInvokeService.java b/application/src/main/java/org/thingsboard/server/service/script/RemoteJsInvokeService.java index 163028f009..3715580286 100644 --- a/application/src/main/java/org/thingsboard/server/service/script/RemoteJsInvokeService.java +++ b/application/src/main/java/org/thingsboard/server/service/script/RemoteJsInvokeService.java @@ -57,6 +57,9 @@ public class RemoteJsInvokeService extends AbstractJsInvokeService { @Value("${queue.js.max_requests_timeout}") private long maxRequestsTimeout; + @Value("${queue.js.max_exec_requests_timeout}") + private long maxExecRequestsTimeout; + @Getter @Value("${js.remote.max_errors}") private int maxErrors; @@ -170,7 +173,7 @@ public class RemoteJsInvokeService extends AbstractJsInvokeService { .setScriptIdMSB(scriptId.getMostSignificantBits()) .setScriptIdLSB(scriptId.getLeastSignificantBits()) .setFunctionName(functionName) - .setTimeout((int) (maxRequestsTimeout * 0.75)) // timeout on JS executor must be less than on Java + .setTimeout((int) maxExecRequestsTimeout) .setScriptBody(scriptBody); for (Object arg : args) { diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index bccd35851e..cc009029cf 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -1044,7 +1044,9 @@ queue: # JS Eval max request timeout max_eval_requests_timeout: "${REMOTE_JS_MAX_EVAL_REQUEST_TIMEOUT:60000}" # JS max request timeout - max_requests_timeout: "${REMOTE_JS_MAX_REQUEST_TIMEOUT:1500}" + max_requests_timeout: "${REMOTE_JS_MAX_REQUEST_TIMEOUT:10000}" + # JS execution max request timeout + max_exec_requests_timeout: "${REMOTE_JS_MAX_EXEC_REQUEST_TIMEOUT:2000}" # JS response poll interval response_poll_interval: "${REMOTE_JS_RESPONSE_POLL_INTERVAL_MS:25}" rule-engine: