(crawler) Fix bug in SQL statement

Arguments were in the wrong order in inserting fetching sites submitted to be crawled
This commit is contained in:
Viktor Lofgren 2023-10-29 13:19:17 +01:00
parent f6fcb04817
commit abb42f0f36

View File

@ -51,13 +51,12 @@ public class DomainListRefreshService {
// Case 1: The domains are in the table, but have no affinity defined
for (var domain : domainsAll) {
update.setString(1, domain.toLowerCase());
update.setInt(2, nodeId);
update.setInt(1, nodeId);
update.setString(2, domain.toLowerCase());
update.addBatch();
}
update.executeBatch();
// Case 2: The domains are missing form the table
for (var domain : domainsAll) {
var parsed = new EdgeDomain(domain);
@ -69,6 +68,10 @@ public class DomainListRefreshService {
insert.executeBatch();
cleanCrawlQueue(conn);
if (!conn.getAutoCommit()) {
conn.commit();
}
}
catch (Exception ex) {
logger.warn("Failed to insert domains", ex);