@5minds/node-red-contrib-processcube-elasticsearch 0.3.1-add-update-cycle-b6ecd7-m3sggsnp → 0.3.1-add-update-cycle-5f3443-m3sifcje
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.
- package/elastic-search-logger.js +15 -2
- package/package.json +1 -1
package/elastic-search-logger.js
CHANGED
|
@@ -152,7 +152,20 @@ module.exports = function (RED) {
|
|
|
152
152
|
},
|
|
153
153
|
});
|
|
154
154
|
|
|
155
|
-
LogElasticLoggerNode.prototype.addToLog = function
|
|
156
|
-
|
|
155
|
+
LogElasticLoggerNode.prototype.addToLog = function addToLog(loglevel, msg) {
|
|
156
|
+
let attempt = 0;
|
|
157
|
+
|
|
158
|
+
const tryLog = () => {
|
|
159
|
+
if (!lock && this.logger) {
|
|
160
|
+
this.logger.log(loglevel, msg.payload.message, msg.payload.meta);
|
|
161
|
+
} else if (attempt < 5) {
|
|
162
|
+
attempt++;
|
|
163
|
+
setTimeout(tryLog, 10);
|
|
164
|
+
} else {
|
|
165
|
+
this.error('Failed to log message after multiple attempts due to logger lock.');
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
tryLog();
|
|
157
170
|
};
|
|
158
171
|
};
|
package/package.json
CHANGED