dev comment all yandex search
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-03-17 11:28:25 +07:00
parent 566c1634a2
commit 28bc24647a
@@ -50,9 +50,9 @@ public class ImageFoundRequestHandler implements RequestHandler {
Map.of("fileId",fileId))); Map.of("fileId",fileId)));
}); });
String searchResponseYandex; // String searchResponseYandex;
String searchResponseGoogle; String searchResponseGoogle;
List<YandexSearchResponse.ImageResult> allYandexImages = new ArrayList<>(); // List<YandexSearchResponse.ImageResult> allYandexImages = new ArrayList<>();
List<YandexSearchResponse.ImageResult> allGoogleImages = new ArrayList<>(); List<YandexSearchResponse.ImageResult> allGoogleImages = new ArrayList<>();
List<YandexSearchResponse.ImageResult> allUniqueImages; List<YandexSearchResponse.ImageResult> allUniqueImages;
boolean hasTimeout = false; boolean hasTimeout = false;
@@ -71,21 +71,21 @@ public class ImageFoundRequestHandler implements RequestHandler {
log.error("Google search failed for file {}", fileId, e); log.error("Google search failed for file {}", fileId, e);
} }
try { // try {
searchResponseYandex = searchImageService.searchReverseByPublicUrl(fileEntity, "yandex_reverse_image", // searchResponseYandex = searchImageService.searchReverseByPublicUrl(fileEntity, "yandex_reverse_image",
"visual_matches"); // "visual_matches");
log.info("searchResponseYandex OK"); // log.info("searchResponseYandex OK");
allYandexImages = searchImageService.getAllImagesWithoutPagination( // allYandexImages = searchImageService.getAllImagesWithoutPagination(
searchResponseYandex, "visual_matches"); // searchResponseYandex, "visual_matches");
} catch (TimeoutException e) { // } catch (TimeoutException e) {
log.warn("Yandex search timeout for file {}", fileId); // log.warn("Yandex search timeout for file {}", fileId);
hasTimeout = true; // hasTimeout = true;
} catch (IOException e) { // } catch (IOException e) {
log.error("Yandex search failed for file {}", fileId, e); // log.error("Yandex search failed for file {}", fileId, e);
} // }
allUniqueImages = searchImageService.removeDuplicateUrls(allYandexImages, allGoogleImages); // allUniqueImages = searchImageService.removeDuplicateUrls(allYandexImages, allGoogleImages);
// allUniqueImages = allGoogleImages; allUniqueImages = allGoogleImages;
// allUniqueImages = allYandexImages; // allUniqueImages = allYandexImages;
log.info("allUniqueImages OK: {} images", allUniqueImages.size()); log.info("allUniqueImages OK: {} images", allUniqueImages.size());