mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Apply suggestions from code review
This commit is contained in:
parent
20d2c11154
commit
aa0225f59f
@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-timeout"><i class="fa fa-clock"></i> <span data-i18n="function.label.timeout"></span></label>
|
<label for="node-input-timeout"><i class="fa fa-clock"></i> <span data-i18n="function.label.timeout"></span></label>
|
||||||
<input id="node-input-timeout" style="width: 60px;" value="1000">
|
<input id="node-input-timeout" style="width: 60px;" data-i18n="[placeholder]join.seconds">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row node-input-libs-row hide" style="margin-bottom: 0px;">
|
<div class="form-row node-input-libs-row hide" style="margin-bottom: 0px;">
|
||||||
@ -470,10 +470,10 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 4294967295 is max in node.js timeout.
|
// 4294967 is max in node.js timeout.
|
||||||
$( "#node-input-timeout" ).spinner({
|
$( "#node-input-timeout" ).spinner({
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 4294967294,
|
max: 4294967,
|
||||||
change: function(event, ui) {
|
change: function(event, ui) {
|
||||||
var value = this.value;
|
var value = this.value;
|
||||||
if(value == ""){
|
if(value == ""){
|
||||||
|
@ -96,7 +96,7 @@ module.exports = function(RED) {
|
|||||||
node.name = n.name;
|
node.name = n.name;
|
||||||
node.func = n.func;
|
node.func = n.func;
|
||||||
node.outputs = n.outputs;
|
node.outputs = n.outputs;
|
||||||
node.timeout = n.timeout*1;
|
node.timeout = n.timeout*1000;
|
||||||
if(node.timeout>0){
|
if(node.timeout>0){
|
||||||
node.timeoutOptions = {
|
node.timeoutOptions = {
|
||||||
timeout:node.timeout,
|
timeout:node.timeout,
|
||||||
|
@ -217,7 +217,7 @@
|
|||||||
"finalize": "Stopp",
|
"finalize": "Stopp",
|
||||||
"outputs": "Ausgänge",
|
"outputs": "Ausgänge",
|
||||||
"modules": "Module",
|
"modules": "Module",
|
||||||
"timeout": "Timeout (ms)"
|
"timeout": "Timeout"
|
||||||
},
|
},
|
||||||
"text": {
|
"text": {
|
||||||
"initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\n",
|
"initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\n",
|
||||||
|
@ -253,7 +253,7 @@
|
|||||||
"finalize": "On Stop",
|
"finalize": "On Stop",
|
||||||
"outputs": "Outputs",
|
"outputs": "Outputs",
|
||||||
"modules": "Modules",
|
"modules": "Modules",
|
||||||
"timeout": "Timeout (ms)"
|
"timeout": "Timeout"
|
||||||
},
|
},
|
||||||
"text": {
|
"text": {
|
||||||
"initialize": "// Code added here will be run once\n// whenever the node is started.\n",
|
"initialize": "// Code added here will be run once\n// whenever the node is started.\n",
|
||||||
|
@ -213,7 +213,7 @@
|
|||||||
"initialize": "Настройка",
|
"initialize": "Настройка",
|
||||||
"finalize": "Закрытие",
|
"finalize": "Закрытие",
|
||||||
"outputs": "Выходы",
|
"outputs": "Выходы",
|
||||||
"timeout":"Время ожидания (мс)"
|
"timeout":"Время ожидания"
|
||||||
},
|
},
|
||||||
"text": {
|
"text": {
|
||||||
"initialize": "// Добавленный здесь код будет исполняться\n// однократно при развертывании узла.\n",
|
"initialize": "// Добавленный здесь код будет исполняться\n// однократно при развертывании узла.\n",
|
||||||
|
@ -1425,7 +1425,7 @@ describe('function node', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should timeout if timeout is set', function(done) {
|
it('should timeout if timeout is set', function(done) {
|
||||||
var flow = [{id:"n1",type:"function",wires:[["n2"]],timeout:"10",func:"while(1==1){};\nreturn msg;"}];
|
var flow = [{id:"n1",type:"function",wires:[["n2"]],timeout:"0.010",func:"while(1==1){};\nreturn msg;"}];
|
||||||
helper.load(functionNode, flow, function() {
|
helper.load(functionNode, flow, function() {
|
||||||
var n1 = helper.getNode("n1");
|
var n1 = helper.getNode("n1");
|
||||||
n1.receive({payload:"foo",topic: "bar"});
|
n1.receive({payload:"foo",topic: "bar"});
|
||||||
|
Loading…
Reference in New Issue
Block a user