(minor) Fix accidental commit errors

This commit is contained in:
Viktor Lofgren 2024-09-23 18:03:09 +02:00
parent e9854f194c
commit 162fc25ebc
5 changed files with 14 additions and 3 deletions

View File

@ -20,6 +20,7 @@ public class AnchorTagsSourceFactory {
private final int nodeId;
private final HikariDataSource dataSource;
private static final Logger logger = LoggerFactory.getLogger(AnchorTagsSourceFactory.class);
@Inject
public AnchorTagsSourceFactory(HikariDataSource dataSource,
ProcessConfiguration config)
@ -30,7 +31,14 @@ public class AnchorTagsSourceFactory {
}
public AnchorTagsSource create() throws SQLException {
return create(getRelevantDomainsByNodeAffinity());
try {
return create(getRelevantDomainsByNodeAffinity());
}
catch (Exception e) {
// likely a test environment
logger.warn("Failed to create anchor tags source", e);
return domain -> new DomainLinks();
}
}
public AnchorTagsSource create(List<EdgeDomain> relevantDomains) throws SQLException {

View File

@ -105,6 +105,8 @@ public class CrawlingThenConvertingIntegrationTest {
CrawledDomain crawlData = crawl(specs);
System.out.println(crawlData);
assertEquals("REDIRECT", crawlData.crawlerStatus);
assertEquals("www.marginalia.nu", crawlData.redirectDomain);
assertTrue(crawlData.doc.isEmpty());

View File

@ -127,7 +127,7 @@ public class HttpFetcherImpl implements HttpFetcher {
EdgeUrl requestUrl = new EdgeUrl(rsp.request().url().toString());
if (!Objects.equals(requestUrl.domain, url.domain)) {
return new ProbeResultRedirect(url.domain);
return new ProbeResultRedirect(requestUrl.domain);
}
return new ProbeResultOk(requestUrl);
}

View File

@ -42,6 +42,7 @@ class CrawledDocumentParquetRecordFileWriterTest {
Instant.now(),
"text/html",
"hello world".getBytes(),
null,
null, null);
// Write the record to a file

View File

@ -96,7 +96,7 @@ public class ScreenshotCaptureToolMain {
private static byte[] fetchDomain(HttpClient client, EdgeDomain domain) {
try {
Map<String, Object> requestData = Map.of(
"url", domain.toRootUrlHttp().toString(),
"url", domain.toRootUrl().toString(),
"options",
Map.of("fullPage", false,
"type", "png"),