Skip to content

Commit

Permalink
perf: Remove feed build dates to improve caching
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jul 11, 2024
1 parent 31a9f30 commit 47e265f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions internal/docker/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"html"
"net/http"
"slices"
"time"

"github.com/gabe565/transsmute/internal/feed"
"github.com/go-chi/chi/v5"
Expand Down Expand Up @@ -50,11 +49,10 @@ func Handler(registries Registries) http.HandlerFunc {
slices.Reverse(tags)

f := &feeds.Feed{
Title: "Docker - " + repo,
Link: &feeds.Link{Href: reg.GetRepoURL(repo).String()},
Author: owner,
Created: time.Now(),
Items: make([]*feeds.Item, 0, len(tags)),
Title: "Docker - " + repo,
Link: &feeds.Link{Href: reg.GetRepoURL(repo).String()},
Author: owner,
Items: make([]*feeds.Item, 0, len(tags)),
}

for _, tag := range tags {
Expand Down
2 changes: 2 additions & 0 deletions internal/kemono/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ func (c *Creator) Podcast(ctx context.Context, pages uint64, tag, query string)
if !setPubDate {
if edited.IsZero() {
f.AddPubDate(&published.Time)
f.AddLastBuildDate(&published.Time)
} else {
f.AddPubDate(&edited.Time)
f.AddLastBuildDate(&edited.Time)
}
setPubDate = true
}
Expand Down
2 changes: 0 additions & 2 deletions internal/youtube/playlist/playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"net/url"
"slices"
"time"

"github.com/gorilla/feeds"
"google.golang.org/api/youtube/v3"
Expand Down Expand Up @@ -64,7 +63,6 @@ func (p Playlist) Feed(ctx context.Context) (*feeds.Feed, error) {
Author: &feeds.Author{
Name: meta.ChannelTitle,
},
Created: time.Now(),
}

feed.Items, err = p.FeedItems(ctx)
Expand Down

0 comments on commit 47e265f

Please sign in to comment.