File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,11 @@ module.exports = function (RED) {
9999 node . query = config . query ;
100100 node . split = config . split ;
101101 node . rowsPerMsg = config . rowsPerMsg ;
102- node . config = RED . nodes . getNode ( config . postgreSQLConfig ) ;
102+ node . config = RED . nodes . getNode ( config . postgreSQLConfig ) || {
103+ pgPool : {
104+ totalCount : 0 ,
105+ } ,
106+ } ;
103107
104108 // Declare the ability of this node to provide ticks upstream for back-pressure
105109 node . tickProvider = true ;
@@ -128,7 +132,7 @@ module.exports = function (RED) {
128132 let fill = 'grey' ;
129133 if ( hasError ) {
130134 fill = 'red' ;
131- } else if ( nbQueue <= 0 || ! node . config . pgPool ) {
135+ } else if ( nbQueue <= 0 ) {
132136 fill = 'blue' ;
133137 } else if ( nbQueue <= node . config . pgPool . totalCount ) {
134138 fill = 'green' ;
@@ -137,7 +141,7 @@ module.exports = function (RED) {
137141 }
138142 node . status ( {
139143 fill,
140- shape : hasError || ! node . config . pgPool || nbQueue > node . config . pgPool . totalCount ? 'ring' : 'dot' ,
144+ shape : hasError || nbQueue > node . config . pgPool . totalCount ? 'ring' : 'dot' ,
141145 text : 'Queue: ' + nbQueue + ( hasError ? ' Error!' : '' ) ,
142146 } ) ;
143147 hasError = false ;
You can’t perform that action at this time.
0 commit comments