diff --git a/releasechecker.go b/releasechecker.go index f62f746..d455df2 100644 --- a/releasechecker.go +++ b/releasechecker.go @@ -98,7 +98,9 @@ func (c *Checker) query(owner, name string) (Repository, error) { "name": githubql.String(name), } - if err := c.client.Query(context.Background(), &query, variables); err != nil { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + if err := c.client.Query(ctx, &query, variables); err != nil { return Repository{}, err } diff --git a/slack.go b/slack.go index af1ab13..41cd842 100644 --- a/slack.go +++ b/slack.go @@ -45,7 +45,7 @@ func (s *SlackSender) Send(repository Repository) error { if err != nil { return err } - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) req = req.WithContext(ctx) defer cancel()