Enhance tender recommendation service with caching and parallel processing
continuous-integration/drone/push Build is passing

- Introduced a caching mechanism for translation responses in the tender recommendation service, improving efficiency by reducing redundant translation requests.
- Refactored the `enrichWithTranslation` method to support an optional translation cache, allowing for faster retrieval of stored translations.
- Implemented parallel processing for building recommended tender responses, utilizing goroutines to enhance performance and responsiveness.
- Added unit tests to validate the new caching behavior and ensure the correct application of translations in various scenarios.

This update significantly improves the performance and responsiveness of the tender recommendation service by integrating caching and parallel processing, enhancing the overall user experience.
This commit is contained in:
Mazyar
2026-07-08 00:57:52 +03:30
parent 0e4fadaf29
commit 107469c328
5 changed files with 266 additions and 38 deletions
@@ -77,6 +77,7 @@ func TestBuildRecommendedTenderResponseAppliesStoredTranslation(t *testing.T) {
"Strong fit",
"PROC_folder-1/00123456-2026",
"fr",
nil,
)
if resp.Title != "Titre traduit" {
@@ -120,6 +121,7 @@ func TestBuildRecommendedTenderResponseKeepsOriginalTextWithoutStoredTranslation
"Fallback",
"PROC_folder-1/00123456-2026",
"fr",
nil,
)
if resp.Title != "Original title" {