Refactor recommendation page cache handling and configuration
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
- Removed the `RecommendationPageCacheLanguages` configuration from `AISummarizerConfig` to streamline cache management. - Updated the `companyService` and `tenderService` to utilize the new `InvalidateRecommendedTendersPageCache` method for cache invalidation, enhancing clarity and efficiency. - Refactored the `invalidateRecommendedTendersPageCache` method to eliminate unnecessary context parameters, simplifying the function signature. - Improved the handling of page cache refresh logic by consolidating language handling within the `tenderService`, ensuring consistent behavior across services. - Cleaned up related tests and removed deprecated functions to maintain code quality and readability. This update enhances the maintainability of the recommendation caching system by simplifying configuration and improving cache invalidation logic.
This commit is contained in:
@@ -42,13 +42,3 @@ func TestFilterCachedRecommendedTendersAppliesActiveAndRejectedFilters(t *testin
|
||||
t.Fatalf("got ID %q, want active tender", got[0].ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParsePageCacheLanguagesConfig(t *testing.T) {
|
||||
got := ParsePageCacheLanguagesConfig("en,fr, en")
|
||||
if len(got) != 2 {
|
||||
t.Fatalf("len = %d, want 2", len(got))
|
||||
}
|
||||
if got[0] != "en" || got[1] != "fr" {
|
||||
t.Fatalf("got %v, want [en fr]", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user