dev add check count for all type
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-03-16 14:40:34 +07:00
parent c56b2ba4e9
commit 73fd5e9456
2 changed files with 29 additions and 29 deletions
@@ -50,7 +50,7 @@ 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<>();
@@ -70,18 +70,18 @@ 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);
log.info("allUniqueImages OK: {} images", allUniqueImages.size()); log.info("allUniqueImages OK: {} images", allUniqueImages.size());
@@ -105,22 +105,22 @@ public class GlobalSearchAsyncProcessor {
log.error("Google search failed for file {}", file.getId(), e); log.error("Google search failed for file {}", file.getId(), e);
} }
// try { try {
// String searchResponseYandex = searchImageService.searchReverseByPublicUrl( String searchResponseYandex = searchImageService.searchReverseByPublicUrl(
// file, "yandex_reverse_image", "visual_matches"); file, "yandex_reverse_image", "visual_matches");
//
// List<YandexSearchResponse.ImageResult> yandexImages = List<YandexSearchResponse.ImageResult> yandexImages =
// searchImageService.getAllImagesWithoutPagination(searchResponseYandex, "visual_matches"); searchImageService.getAllImagesWithoutPagination(searchResponseYandex, "visual_matches");
//
// allUniqueImages.addAll(yandexImages); allUniqueImages.addAll(yandexImages);
// log.info("Yandex search OK for file {}", file.getId()); log.info("Yandex search OK for file {}", file.getId());
//
// } catch (TimeoutException e) { } catch (TimeoutException e) {
// log.warn("Yandex search timeout for file {}", file.getId()); log.warn("Yandex search timeout for file {}", file.getId());
// hasTimeout = true; hasTimeout = true;
// } catch (IOException e) { } catch (IOException e) {
// log.error("Yandex search failed for file {}", file.getId(), e); log.error("Yandex search failed for file {}", file.getId(), e);
// } }
allUniqueImages = searchImageService.removeDuplicateUrls( allUniqueImages = searchImageService.removeDuplicateUrls(
allUniqueImages.stream() allUniqueImages.stream()