fix: address code review findings

This commit is contained in:
2026-08-18 14:25:34 +03:00
parent 48650d96cf
commit 0d603ad15f
6 changed files with 56 additions and 24 deletions

View File

@@ -167,6 +167,11 @@ func GetSearchKey(from, to, date string) *CacheKey {
return &CacheKey{Kind: "search", From: from, To: to, Date: date}
}
// GetSearchKeyWithFarTerm returns the cache key for a search query with far-term flag.
func GetSearchKeyWithFarTerm(from, to, date, farTermFlag string) *CacheKey {
return &CacheKey{Kind: "search", From: from, To: to, Date: date, Request: farTermFlag}
}
// CacheAside represents the cache-aside pattern implementation.
// It follows the pattern: Redis → miss → Postgres/API → write-back to Redis.
type CacheAside struct {