Skip to content

Commit

Permalink
fix: increase request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed May 29, 2024
1 parent c7f1c0e commit bd60580
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/brassite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func runWorker(feed brassite.Feed) {
for {
slog.Debug("Starting worker", slog.String("feed_name", feed.Name), slog.String("url", feed.URL), slog.Duration("interval", feed.Interval))

ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)

// Call the feed parser
request, err := http.NewRequestWithContext(ctx, http.MethodGet, feed.URL, nil)
Expand All @@ -119,6 +119,9 @@ func runWorker(feed brassite.Feed) {
continue
}

request.Header.Add("Accept", "*/*")
request.Header.Add("User-Agent", "Brassite/1.0")

for key, value := range feed.Headers {
request.Header.Add(key, value)
}
Expand Down

0 comments on commit bd60580

Please sign in to comment.