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

This commit is contained in:
vladp
2026-03-16 14:18:56 +07:00
parent 68e102b6ce
commit 9186a6d9b0
2 changed files with 20 additions and 20 deletions
@@ -50,7 +50,7 @@ public class ImageFoundRequestHandler implements RequestHandler {
Map.of("fileId",fileId)));
});
// String searchResponseYandex;
String searchResponseYandex;
String searchResponseGoogle;
List<YandexSearchResponse.ImageResult> allYandexImages = 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);
}
// 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 {
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());
@@ -56,15 +56,15 @@ public class MonitoringSearchService {
try {
tariffInfoService.writeOffTokens(monitoring.getUserId(), tariffMonitoring.getTokens());
// String yandexResponse = searchImageService.searchReverseByPublicUrl(
// monitoring.getFile(), "yandex_reverse_image", "visual_matches");
String yandexResponse = searchImageService.searchReverseByPublicUrl(
monitoring.getFile(), "yandex_reverse_image", "visual_matches");
// List<YandexSearchResponse.ImageResult> yandexImages =
// searchImageService.getAllImagesWithoutPagination(yandexResponse, "visual_matches");
List<YandexSearchResponse.ImageResult> yandexImages =
searchImageService.getAllImagesWithoutPagination(yandexResponse, "visual_matches");
// for (YandexSearchResponse.ImageResult imageResult : yandexImages) {
// violationService.processViolation(imageResult, monitoring.getFile(), null);
// }
for (YandexSearchResponse.ImageResult imageResult : yandexImages) {
violationService.processViolation(imageResult, monitoring.getFile(), null);
}
try {
String googleResponse = searchImageService.searchReverseByPublicUrl(