(ldb) add OR IGNORE to insert status query

Otherwise it will sometimes fail because documents may appear more than once in error scenarios.
This commit is contained in:
Viktor Lofgren 2023-08-30 10:34:01 +02:00
parent e4d7958379
commit 048f685073

View File

@ -33,7 +33,7 @@ public class LinkdbStatusWriter {
public void add(List<UrlStatus> statuses) throws SQLException { public void add(List<UrlStatus> statuses) throws SQLException {
try (var stmt = connection.prepareStatement(""" try (var stmt = connection.prepareStatement("""
INSERT INTO STATUS(ID, URL, STATUS, DESCRIPTION) INSERT OR IGNORE INTO STATUS(ID, URL, STATUS, DESCRIPTION)
VALUES (?, ?, ?, ?) VALUES (?, ?, ?, ?)
""")) { """)) {
int count = 0; int count = 0;