node-red-contrib-questdb 0.6.2 → 0.6.3

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.
Files changed (2) hide show
  1. package/nodes/questdb.js +18 -2
  2. package/package.json +1 -1
package/nodes/questdb.js CHANGED
@@ -371,7 +371,15 @@ module.exports = function (RED) {
371
371
  return; // Don't complete the row, let reconnection handle it
372
372
  }
373
373
  node.error(formatError(tsErr, { operation: 'timestamp', table: tableName }), msg);
374
- connection.sender.atNow(); // Complete the row to avoid buffer corruption
374
+ try {
375
+ connection.sender.atNow(); // Complete the row to avoid buffer corruption
376
+ } catch (cleanupErr) {
377
+ // If even cleanup fails, log and trigger reconnection
378
+ if (cleanupErr.message && cleanupErr.message.includes('TCP transport is not connected')) {
379
+ node.error('TCP transport disconnected during cleanup, reconnecting...', msg);
380
+ connection.updateState(false, cleanupErr.message);
381
+ }
382
+ }
375
383
  }
376
384
  } else {
377
385
  // QuestDB format: payload.symbols + payload.columns
@@ -501,7 +509,15 @@ module.exports = function (RED) {
501
509
  return; // Don't complete the row, let reconnection handle it
502
510
  }
503
511
  node.error(formatError(tsErr, { operation: 'timestamp', table: tableName }), msg);
504
- connection.sender.atNow(); // Complete the row
512
+ try {
513
+ connection.sender.atNow(); // Complete the row
514
+ } catch (cleanupErr) {
515
+ // If even cleanup fails, log and trigger reconnection
516
+ if (cleanupErr.message && cleanupErr.message.includes('TCP transport is not connected')) {
517
+ node.error('TCP transport disconnected during cleanup, reconnecting...', msg);
518
+ connection.updateState(false, cleanupErr.message);
519
+ }
520
+ }
505
521
  return; // Early return - don't continue with potentially bad data
506
522
  }
507
523
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-questdb",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
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"