1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Viktor Lofgren
f1a71e9033 (ndp) Deprioritize tumblr in the visitation order 2025-10-05 12:17:46 +02:00
Viktor Lofgren
7b525918c9 (ndp) Deprioritize tumblr in the visitation order 2025-10-05 12:16:05 +02:00
Viktor Lofgren
0f3aede66f (ndp) Clean up code 2025-10-05 11:56:41 +02:00
Viktor Lofgren
88236f3836 (ndp) Use mariadb syntax instead of sqlite syntax when querying mariadb 2025-10-05 11:56:31 +02:00
2 changed files with 4 additions and 3 deletions

View File

@@ -38,7 +38,6 @@ public class DomainTestingQueue {
this.dataSource = dataSource;
this.linkGraphClient = linkGraphClient;
Thread.ofPlatform()
.name("DomainTestingQueue::fetch()")
.start(this::fetch);
@@ -203,7 +202,7 @@ public class DomainTestingQueue {
/* Insert new domains into NDP_NEW_DOMAINS table */
try (var insertStmt = conn.prepareStatement("""
INSERT INTO NDP_NEW_DOMAINS (DOMAIN_ID, PRIORITY) VALUES (?, ?)
ON CONFLICT(DOMAIN_ID) DO UPDATE SET PRIORITY = excluded.PRIORITY
ON DUPLICATE KEY UPDATE PRIORITY = VALUES(PRIORITY)
""")) {
conn.setAutoCommit(false);
@@ -238,7 +237,10 @@ public class DomainTestingQueue {
// This acts not only to clean up domains that we've flagged as ACCEPTED, but also to
// repair inconsistent states where domains might have incorrectly been added to NDP_NEW_DOMAINS
try (var stmt = conn.createStatement()) {
conn.setAutoCommit(false);
stmt.executeUpdate("DELETE FROM NDP_NEW_DOMAINS WHERE DOMAIN_ID IN (SELECT ID FROM EC_DOMAIN WHERE NODE_AFFINITY>=0)");
stmt.executeUpdate("UPDATE NDP_NEW_DOMAINS INNER JOIN EC_DOMAIN ON EC_DOMAIN.ID=NDP_NEW_DOMAINS.DOMAIN_ID SET PRIORITY=1 WHERE DOMAIN_TOP='tumblr.com'");
conn.commit();
}
catch (Exception e) {
throw new RuntimeException("Failed to clean up NDP_NEW_DOMAINS", e);

View File

@@ -58,7 +58,6 @@ public class NdpMain extends ProcessMainClass {
public void run(int goalCount) throws InterruptedException {
logger.info("Wait for blacklist to load...");
domainBlacklist.waitUntilLoaded();
SimpleBlockingThreadPool threadPool = new SimpleBlockingThreadPool(