1
0
Fork 1
mirror of https://github.com/0x2E/fusion.git synced 2025-06-08 05:27:15 +09:00

Rename pull.FetchFeeds to FetchFeed

If I understand correctly, the function fetches a single feed, so the name should be FetchFeed to reflect the function's purpose.
This commit is contained in:
Michael Lynch 2025-02-24 20:57:21 -05:00
parent 7f33caf701
commit 235e93b0fd
2 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@ func (f Feed) Create(ctx context.Context, req *ReqFeedCreate) error {
func (f Feed) CheckValidity(ctx context.Context, req *ReqFeedCheckValidity) (*RespFeedCheckValidity, error) { func (f Feed) CheckValidity(ctx context.Context, req *ReqFeedCheckValidity) (*RespFeedCheckValidity, error) {
link := req.Link link := req.Link
validLinks := make([]ValidityItem, 0) validLinks := make([]ValidityItem, 0)
parsed, err := pull.FetchFeeds(ctx, &model.Feed{Link: &link}) parsed, err := pull.FetchFeed(ctx, &model.Feed{Link: &link})
if err == nil && parsed != nil { if err == nil && parsed != nil {
validLinks = append(validLinks, ValidityItem{ validLinks = append(validLinks, ValidityItem{
Title: &parsed.Title, Title: &parsed.Title,

View file

@ -33,7 +33,7 @@ func (p *Puller) do(ctx context.Context, f *model.Feed, force bool) error {
} }
failure := "" failure := ""
fetched, err := FetchFeeds(ctx, f) fetched, err := FetchFeed(ctx, f)
if err != nil { if err != nil {
failure = err.Error() failure = err.Error()
p.feedRepo.Update(f.ID, &model.Feed{Failure: &failure}) p.feedRepo.Update(f.ID, &model.Feed{Failure: &failure})
@ -77,7 +77,7 @@ func (p *Puller) do(ctx context.Context, f *model.Feed, force bool) error {
}) })
} }
func FetchFeeds(ctx context.Context, f *model.Feed) (*gofeed.Feed, error) { func FetchFeed(ctx context.Context, f *model.Feed) (*gofeed.Feed, error) {
resp, err := httpx.FusionRequest(ctx, *f.Link, &f.FeedRequestOptions) resp, err := httpx.FusionRequest(ctx, *f.Link, &f.FeedRequestOptions)
if err != nil { if err != nil {
return nil, err return nil, err