(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:
parent
f6fcb04817
commit
abb42f0f36
1 changed files with 6 additions and 3 deletions
|
@ -51,13 +51,12 @@ public class DomainListRefreshService {
|
||||||
|
|
||||||
// Case 1: The domains are in the table, but have no affinity defined
|
// Case 1: The domains are in the table, but have no affinity defined
|
||||||
for (var domain : domainsAll) {
|
for (var domain : domainsAll) {
|
||||||
update.setString(1, domain.toLowerCase());
|
update.setInt(1, nodeId);
|
||||||
update.setInt(2, nodeId);
|
update.setString(2, domain.toLowerCase());
|
||||||
update.addBatch();
|
update.addBatch();
|
||||||
}
|
}
|
||||||
update.executeBatch();
|
update.executeBatch();
|
||||||
|
|
||||||
|
|
||||||
// Case 2: The domains are missing form the table
|
// Case 2: The domains are missing form the table
|
||||||
for (var domain : domainsAll) {
|
for (var domain : domainsAll) {
|
||||||
var parsed = new EdgeDomain(domain);
|
var parsed = new EdgeDomain(domain);
|
||||||
|
@ -69,6 +68,10 @@ public class DomainListRefreshService {
|
||||||
insert.executeBatch();
|
insert.executeBatch();
|
||||||
|
|
||||||
cleanCrawlQueue(conn);
|
cleanCrawlQueue(conn);
|
||||||
|
|
||||||
|
if (!conn.getAutoCommit()) {
|
||||||
|
conn.commit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
logger.warn("Failed to insert domains", ex);
|
logger.warn("Failed to insert domains", ex);
|
||||||
|
|
Loading…
Reference in a new issue