aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/parse.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2022-01-08 20:08:36 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2022-01-08 20:08:36 +0100
commit5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e (patch)
tree130f59f0b659f9e23d6cd79a5dbc54e7910ae0b7 /internal/feed/parse.go
parent180aa45d40e5d58d579fcaba44b94bcb8e3e08be (diff)
downloadfeed2imap-go-5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e.tar.gz
feed2imap-go-5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e.tar.bz2
feed2imap-go-5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e.zip
Introduce http.Context to bundle http specific parameters
Diffstat (limited to '')
-rw-r--r--internal/feed/parse.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/feed/parse.go b/internal/feed/parse.go
index 520def8..a471b2d 100644
--- a/internal/feed/parse.go
+++ b/internal/feed/parse.go
@@ -20,7 +20,7 @@ func (feed *Feed) Parse() error {
if feed.Url != "" {
// we do not use the http support in gofeed, so that we can control the behavior of http requests
// and ensure it to be the same in all places
- resp, cancel, err := http.Get(feed.Url, feed.Global.Timeout, feed.NoTLS)
+ resp, cancel, err := http.Get(feed.Url, feed.Context())
if err != nil {
return fmt.Errorf("while fetching %s from %s: %w", feed.Name, feed.Url, err)
}
@@ -30,7 +30,7 @@ func (feed *Feed) Parse() error {
cleanup = func() error { return nil }
} else { // exec
// we use the same context as for HTTP
- ctx, cancel := http.Context(feed.Global.Timeout)
+ ctx, cancel := feed.Context().StdContext()
cmd := exec.CommandContext(ctx, feed.Exec[0], feed.Exec[1:]...)
defer func() {
cancel()