This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user