From 13c5d4debe6d0f6dff2e01211d645cf4c03e4b23 Mon Sep 17 00:00:00 2001 From: Kilian Hertel Date: Fri, 4 Aug 2023 11:19:35 +0200 Subject: [PATCH] Revert "adding functionTimeout to settings" This reverts commit a44f23c4e206bc31c60153bb180ddd8875f9f9da. --- .../nodes/core/function/10-function.html | 4 --- .../nodes/core/function/10-function.js | 3 +-- packages/node_modules/node-red/settings.js | 5 ---- test/nodes/core/function/10-function_spec.js | 27 ------------------- 4 files changed, 1 insertion(+), 38 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/function/10-function.html b/packages/node_modules/@node-red/nodes/core/function/10-function.html index 1abe9fff8..e17f58aca 100644 --- a/packages/node_modules/@node-red/nodes/core/function/10-function.html +++ b/packages/node_modules/@node-red/nodes/core/function/10-function.html @@ -360,10 +360,6 @@ name: {value:"_DEFAULT_"}, func: {value:"\nreturn msg;"}, outputs: {value:1}, -<<<<<<< Updated upstream -======= - timeout:{value:RED.settings.functionTimeout}, ->>>>>>> Stashed changes noerr: {value:0,required:true, validate: function(v, opt) { if (!v) { diff --git a/packages/node_modules/@node-red/nodes/core/function/10-function.js b/packages/node_modules/@node-red/nodes/core/function/10-function.js index 025c08448..b84ee8571 100644 --- a/packages/node_modules/@node-red/nodes/core/function/10-function.js +++ b/packages/node_modules/@node-red/nodes/core/function/10-function.js @@ -503,8 +503,7 @@ module.exports = function(RED) { RED.nodes.registerType("function",FunctionNode, { dynamicModuleList: "libs", settings: { - functionExternalModules: { value: true, exportable: true }, - functionTimeout: { value:0, exportable: true } + functionExternalModules: { value: true, exportable: true } } }); RED.library.register("functions"); diff --git a/packages/node_modules/node-red/settings.js b/packages/node_modules/node-red/settings.js index 43b660ffa..ac58f280a 100644 --- a/packages/node_modules/node-red/settings.js +++ b/packages/node_modules/node-red/settings.js @@ -454,9 +454,6 @@ module.exports = { /** Allow the Function node to load additional npm modules directly */ functionExternalModules: true, - /** a default timeout for function node VM*/ - functionTimeout:30, - /** The following property can be used to set predefined values in Global Context. * This allows extra node modules to be made available with in Function node. * For example, the following: @@ -468,8 +465,6 @@ module.exports = { // os:require('os'), }, - - /** The maximum number of messages nodes will buffer internally as part of their * operation. This applies across a range of nodes that operate on message sequences. * defaults to no limit. A value of 0 also means no limit is applied. diff --git a/test/nodes/core/function/10-function_spec.js b/test/nodes/core/function/10-function_spec.js index f5d7b3a25..4f7f0b806 100644 --- a/test/nodes/core/function/10-function_spec.js +++ b/test/nodes/core/function/10-function_spec.js @@ -1426,33 +1426,6 @@ describe('function node', function() { - it('check if default function settings grab', function(done) { - RED.seetings.functionTimeout = 0.01; - var flow = [{id:"n1",type:"function",wires:[["n2"]],func:"while(1==1){};\nreturn msg;"}]; - helper.load(functionNode, flow, function() { - var n1 = helper.getNode("n1"); - n1.receive({payload:"foo",topic: "bar"}); - setTimeout(function() { - try { - helper.log().called.should.be.true(); - var logEvents = helper.log().args.filter(function(evt) { - return evt[0].type == "function"; - }); - logEvents.should.have.length(1); - var msg = logEvents[0][0]; - msg.should.have.property('level', helper.log().ERROR); - msg.should.have.property('id', 'n1'); - msg.should.have.property('type', 'function'); - should.equal(msg.msg.message, 'Script execution timed out after 10ms'); - delete RED.settings.functionExternalModules; - done(); - } catch(err) { - done(err); - } - },50); - }); - }); - describe("finalize function", function() { it('should execute', function(done) {