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

This commit is contained in:
vladp
2026-03-17 11:08:33 +07:00
parent 18c07b427c
commit 59125b4d19
@@ -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;
@@ -70,7 +70,7 @@ 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");
@@ -83,10 +83,11 @@ public class ImageFoundRequestHandler implements RequestHandler {
} 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;
log.info("allUniqueImages OK: {} images", allUniqueImages.size()); log.info("allUniqueImages OK: {} images", allUniqueImages.size());
tariffInfoService.writeOffTokens(fileEntity.getUserId(), TariffConstants.TOKEN_VALUE_FOR_SEARCH); tariffInfoService.writeOffTokens(fileEntity.getUserId(), TariffConstants.TOKEN_VALUE_FOR_SEARCH);