feat(feeds): optimize existing cache items check (#2078)

* feat(feeds): optimize existing items cache check

* feat(feeds): remove ttl from repo method ExistingItems

* feat(feeds): add db integration test for ExistingItems

* feat(feeds): improve release and filter processing

* feat(feeds): fix failing test
This commit is contained in:
ze0s 2025-06-07 12:46:08 +02:00 committed by GitHub
parent 92ddb919a5
commit 46f6fbe5cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 266 additions and 45 deletions

View file

@ -10,7 +10,8 @@ import (
)
var (
ErrRecordNotFound = sql.ErrNoRows
ErrUpdateFailed = errors.New("update failed")
ErrDeleteFailed = errors.New("delete failed")
ErrRecordNotFound = sql.ErrNoRows
ErrUpdateFailed = errors.New("update failed")
ErrDeleteFailed = errors.New("delete failed")
ErrNoActiveFiltersFoundForIndexer = errors.New("no active filters found for indexer")
)

View file

@ -13,6 +13,7 @@ type FeedCacheRepo interface {
GetByFeed(ctx context.Context, feedId int) ([]FeedCacheItem, error)
GetCountByFeed(ctx context.Context, feedId int) (int, error)
Exists(feedId int, key string) (bool, error)
ExistingItems(ctx context.Context, feedId int, keys []string) (map[string]bool, error)
Put(feedId int, key string, val []byte, ttl time.Time) error
PutMany(ctx context.Context, items []FeedCacheItem) error
Delete(ctx context.Context, feedId int, key string) error