Add special command to warm up MVEL engine
This commit is contained in:
parent
323a47a744
commit
b65aa4cc8a
@ -113,6 +113,12 @@ public class DefaultMvelInvokeService extends AbstractScriptInvokeService implem
|
|||||||
parserConfig.addImport("JSON", TbJson.class);
|
parserConfig.addImport("JSON", TbJson.class);
|
||||||
TbUtils.register(parserConfig);
|
TbUtils.register(parserConfig);
|
||||||
executor = MoreExecutors.listeningDecorator(ThingsBoardExecutors.newWorkStealingPool(threadPoolSize, "mvel-executor"));
|
executor = MoreExecutors.listeningDecorator(ThingsBoardExecutors.newWorkStealingPool(threadPoolSize, "mvel-executor"));
|
||||||
|
try {
|
||||||
|
// Special command to warm up MVEL engine
|
||||||
|
MVEL.compileExpression("var warmUp = {}; warmUp", new SandboxedParserContext(parserConfig));
|
||||||
|
} catch (Exception e) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@PreDestroy
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user