node-red-contrib-questdb 0.6.24 → 0.6.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -237,7 +237,11 @@ module.exports = function (RED) {
237
237
  connection.rowCount = 0;
238
238
  } catch (flushErr) {
239
239
  var flushErrMsg = formatError(flushErr, { operation: 'flush', table: tableName });
240
- RED.log.error('[QuestDB] Flush failed: ' + flushErrMsg);
240
+ var flushNow = Date.now();
241
+ if (flushNow - connection.lastFlushErrorLog > 5000) {
242
+ connection.lastFlushErrorLog = flushNow;
243
+ RED.log.error('[QuestDB] Flush failed: ' + flushErrMsg);
244
+ }
241
245
  if (isDisconnectionError(flushErr)) {
242
246
  connection.updateState(false, flushErr.message);
243
247
  connection.sender = null;
package/nodes/questdb.js CHANGED
@@ -107,6 +107,7 @@ module.exports = function (RED) {
107
107
  emitter: new EventEmitter(),
108
108
  lastError: null,
109
109
  lastNotConnectedLog: 0,
110
+ lastFlushErrorLog: 0,
110
111
 
111
112
  // Method to update state and emit event
112
113
  updateState: function (newStatus, error = null) {
@@ -179,7 +180,11 @@ module.exports = function (RED) {
179
180
  connectionState.rowCount = 0;
180
181
  } catch (flushErr) {
181
182
  const flushErrMsg = formatError(flushErr, { operation: 'auto-flush' });
182
- RED.log.error(`[QuestDB] Flush failed: ${flushErrMsg}`);
183
+ var now = Date.now();
184
+ if (now - connectionState.lastFlushErrorLog > 5000) {
185
+ connectionState.lastFlushErrorLog = now;
186
+ RED.log.error(`[QuestDB] Flush failed: ${flushErrMsg}`);
187
+ }
183
188
  connectionState.emitter.emit('flushError', flushErr);
184
189
  if (isDisconnectionError(flushErr)) {
185
190
  connectionState.updateState(false, flushErr.message);
@@ -579,7 +584,11 @@ module.exports = function (RED) {
579
584
  connection.rowCount = 0;
580
585
  } catch (flushErr) {
581
586
  const flushErrMsg = formatError(flushErr, { operation: 'flush', table: tableName });
582
- RED.log.error(`[QuestDB] Flush failed: ${flushErrMsg}`);
587
+ var flushNow = Date.now();
588
+ if (flushNow - connection.lastFlushErrorLog > 5000) {
589
+ connection.lastFlushErrorLog = flushNow;
590
+ RED.log.error(`[QuestDB] Flush failed: ${flushErrMsg}`);
591
+ }
583
592
  if (isDisconnectionError(flushErr)) {
584
593
  connection.updateState(false, flushErr.message);
585
594
  connection.sender = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-questdb",
3
- "version": "0.6.24",
3
+ "version": "0.6.25",
4
4
  "description": "Node-RED nodes for writing high-performance time-series data to QuestDB using Influx Line Protocol (ILP). Supports IoT, industrial monitoring, smart buildings, fleet telematics, healthcare, agriculture, and more.",
5
5
  "author": {
6
6
  "name": "Holger Amort"