File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,8 @@ module.exports = function (RED) {
152152 } ;
153153 updateStatus ( 0 , false ) ;
154154
155+ let client = null ;
156+
155157 node . on ( 'input' , async ( msg , send , done ) => {
156158 // 'send' and 'done' require Node-RED 1.0+
157159 send = send || function ( ) { node . send . apply ( node , arguments ) ; } ;
@@ -171,8 +173,6 @@ module.exports = function (RED) {
171173 const partsId = Math . random ( ) ;
172174 let query = msg . query ? msg . query : Mustache . render ( node . query , { msg } ) ;
173175
174- let client = null ;
175-
176176 const handleDone = async ( isError = false ) => {
177177 if ( cursor ) {
178178 cursor . close ( ) ;
@@ -212,7 +212,10 @@ module.exports = function (RED) {
212212 }
213213 } ;
214214
215- handleDone ( ) ;
215+ if ( node . listen ) {
216+ // Avoid multiple listening instances
217+ handleDone ( ) ;
218+ }
216219 updateStatus ( + 1 ) ;
217220 downstreamReady = true ;
218221
You can’t perform that action at this time.
0 commit comments