Skip to content

Commit 72d0469

Browse files
committed
Removed the timeout when a 'periodic' node is changed or deleted
1 parent 1c70e77 commit 72d0469

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arduino-cloud.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ module.exports = function (RED) {
161161
this.propertyName = config.name;
162162
const pollTime = this.timeWindowCount * this.timeWindowUnit;
163163
if(pollTime !== null && pollTime !== "" && pollTime !== undefined && Number.isInteger(parseInt(pollTime)) && parseInt(pollTime) !== 0) {
164-
this.poll(connectionConfig, pollTime);
164+
this.poll(connectionConfig, pollTime);
165+
this.on('close', function () {
166+
if(this.pollTimeoutPoll)
167+
clearTimeout(this.pollTimeoutPoll);
168+
});
165169
}
166170
}
167171
} catch (err) {

0 commit comments

Comments
 (0)