fix(indexers): delete feed with indexer (#1810)

* fix(indexers): delete feed in one go

* fix(indexers): sort imports

* refactor(feeds): db methods for find
This commit is contained in:
ze0s 2024-11-06 20:48:46 +01:00 committed by GitHub
parent 41216babe6
commit 40fe3e9f54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 167 additions and 92 deletions

View file

@ -21,8 +21,8 @@ type FeedCacheRepo interface {
}
type FeedRepo interface {
FindOne(ctx context.Context, params FindOneParams) (*Feed, error)
FindByID(ctx context.Context, id int) (*Feed, error)
FindByIndexerIdentifier(ctx context.Context, indexer string) (*Feed, error)
Find(ctx context.Context) ([]Feed, error)
GetLastRunDataByID(ctx context.Context, id int) (string, error)
Store(ctx context.Context, feed *Feed) error
@ -91,3 +91,9 @@ type FeedCacheItem struct {
Value []byte `json:"value"`
TTL time.Time `json:"ttl"`
}
type FindOneParams struct {
FeedID int
IndexerID int
IndexerIdentifier string
}