A social RSS reader built on the AT Protocol. glean.at
glean atproto atmosphere rss feed social app
14
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix favicon issue hanging fetcher

+12 -1
+11
internal/feed/discover.go
··· 7 7 "net/url" 8 8 "regexp" 9 9 "strings" 10 + "sync" 10 11 "time" 11 12 12 13 "pkg.rbrt.fr/glean/internal/httpclient" ··· 117 118 ctx, cancel := context.WithCancel(ctx) 118 119 defer cancel() 119 120 121 + var wg sync.WaitGroup 120 122 for _, path := range faviconPaths { 123 + wg.Add(1) 121 124 go func(path string) { 125 + defer wg.Done() 122 126 u, _ := url.Parse(path) 123 127 resolved := origin.ResolveReference(u) 124 128 req, err := http.NewRequestWithContext(ctx, http.MethodGet, resolved.String(), nil) ··· 140 144 }(path) 141 145 } 142 146 147 + done := make(chan struct{}) 148 + go func() { 149 + wg.Wait() 150 + close(done) 151 + }() 152 + 143 153 select { 144 154 case r := <-found: 145 155 if r.found { 146 156 return r.url 147 157 } 158 + case <-done: 148 159 case <-ctx.Done(): 149 160 } 150 161 return ""
+1 -1
internal/feed/fetcher.go
··· 209 209 210 210 faviconURL := result.Feed.FaviconURL 211 211 if faviconURL == "" && feed.FaviconURL == "" { 212 - faviconURL = ResolveFavicon(context.Background(), feed.URL, feed.SiteURL) 212 + faviconURL = ResolveFavicon(ctx, feed.URL, feed.SiteURL) 213 213 } 214 214 215 215 if err := s.store.StoreFetchResult(ctx, feed.URL, result.Articles, faviconURL); err != nil {