mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add timeout
This commit is contained in:
@@ -209,7 +209,7 @@ module.exports = function(RED) {
|
||||
try {
|
||||
var start = process.hrtime();
|
||||
sandbox.msg = msg;
|
||||
const vm2Instance = new vm2.VM({ sandbox });
|
||||
const vm2Instance = new vm2.VM({ sandbox, timeout: 5000 });
|
||||
const result = vm2Instance.run(functionText);
|
||||
sendResults(this,msg._msgid, result);
|
||||
|
||||
|
Reference in New Issue
Block a user