From ad1f967a8daf926bebc313abab704d6c9fa61660 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Mon, 3 Feb 2014 13:08:20 +0000 Subject: [PATCH] Fix random wait in delay node Fixes #143 --- nodes/core/core/89-delay.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodes/core/core/89-delay.js b/nodes/core/core/89-delay.js index 92579dd9f..8b387c978 100644 --- a/nodes/core/core/89-delay.js +++ b/nodes/core/core/89-delay.js @@ -16,6 +16,7 @@ //Simple node to introduce a pause into a flow var RED = require(process.env.NODE_RED_HOME+"/red/red"); +var node; function random() { var wait = node.randomFirst + (node.diff * Math.random()); @@ -80,7 +81,7 @@ function DelayNode(n) { this.buffer = []; this.intervalID = -1; this.randomID = -1; - var node = this; + node = this; if (this.pauseType === "delay") { this.on("input", function(msg) {