Skip to content

Commit 4183ff2

Browse files
committed
feat(postgresql): enhance bulk log insertion to ignore invalid entries
1 parent 44bf590 commit 4183ff2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class ErrsolePostgres extends EventEmitter {
266266
INSERT INTO ${this.logsTable} (timestamp, hostname, pid, source, level, message, meta, errsole_id)
267267
VALUES ${logsToPost.map((_, i) =>
268268
`($${i * 8 + 1}, $${i * 8 + 2}, $${i * 8 + 3}, $${i * 8 + 4}, $${i * 8 + 5}, $${i * 8 + 6}, $${i * 8 + 7}, $${i * 8 + 8})`
269-
).join(', ')}
269+
).join(', ')} ON CONFLICT DO NOTHING
270270
`;
271271

272272
const queryParams = values.flat();

0 commit comments

Comments
 (0)