dev add another client for google and yandex
Test Workflow / test (push) Waiting to run

This commit is contained in:
vladp
2026-02-22 02:49:21 +07:00
parent b347958772
commit 69be949f22
2 changed files with 17 additions and 17 deletions
@@ -67,19 +67,6 @@ public class ImageFoundRequestHandler implements RequestHandler {
List<YandexSearchResponse.ImageResult> allUniqueImages;
boolean hasTimeout = false;
try {
searchResponseYandex = searchImageService.searchReverseByPublicUrl(fileEntity, "yandex_reverse_image",
"visual_matches");
log.info("searchResponseYandex OK");
allYandexImages = searchImageService.getAllImagesWithoutPagination(
searchResponseYandex, "visual_matches");
} catch (TimeoutException e) {
log.warn("Yandex search timeout for file {}", fileId);
hasTimeout = true;
} catch (IOException e) {
log.error("Yandex search failed for file {}", fileId, e);
}
try {
searchResponseGoogle = searchImageService.searchReverseByPublicUrl(fileEntity, "google_lens",
"exact_matches");
@@ -93,6 +80,19 @@ public class ImageFoundRequestHandler implements RequestHandler {
log.error("Google search failed for file {}", fileId, e);
}
try {
searchResponseYandex = searchImageService.searchReverseByPublicUrl(fileEntity, "yandex_reverse_image",
"visual_matches");
log.info("searchResponseYandex OK");
allYandexImages = searchImageService.getAllImagesWithoutPagination(
searchResponseYandex, "visual_matches");
} catch (TimeoutException e) {
log.warn("Yandex search timeout for file {}", fileId);
hasTimeout = true;
} catch (IOException e) {
log.error("Yandex search failed for file {}", fileId, e);
}
allUniqueImages = searchImageService.removeDuplicateUrls(allYandexImages, allGoogleImages);
log.info("allUniqueImages OK: {} images", allUniqueImages.size());