Skip to content

Commit

Permalink
Merge pull request #682 from reviewdog/share-round-trip
Browse files Browse the repository at this point in the history
doghouse: Use shared http.RoundTripper
  • Loading branch information
haya14busa committed Jul 22, 2020
2 parents a210751 + 377780b commit f20446e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 2 additions & 6 deletions doghouse/appengine/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ import (
"net/url"
"strings"

"contrib.go.opencensus.io/exporter/stackdriver/propagation"
"github.com/reviewdog/reviewdog/doghouse"
"github.com/reviewdog/reviewdog/doghouse/server"
"github.com/reviewdog/reviewdog/doghouse/server/ciutil"
"github.com/reviewdog/reviewdog/doghouse/server/storage"
"go.opencensus.io/plugin/ochttp"
)

type githubChecker struct {
privateKey []byte
integrationID int
ghInstStore storage.GitHubInstallationStore
ghRepoTokenStore storage.GitHubRepositoryTokenStore
tr http.RoundTripper
}

func (gc *githubChecker) handleCheck(w http.ResponseWriter, r *http.Request) {
Expand All @@ -48,10 +47,7 @@ func (gc *githubChecker) handleCheck(w http.ResponseWriter, r *http.Request) {
IntegrationID: gc.integrationID,
RepoOwner: req.Owner,
Client: &http.Client{
Transport: &ochttp.Transport{
// Use Google Cloud propagation format.
Propagation: &propagation.HTTPFormat{},
},
Transport: gc.tr,
},
}

Expand Down
4 changes: 4 additions & 0 deletions doghouse/appengine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func main() {
integrationID: integrationID,
ghInstStore: &ghInstStore,
ghRepoTokenStore: &ghRepoTokenStore,
tr: &ochttp.Transport{
// Use Google Cloud propagation format.
Propagation: &propagation.HTTPFormat{},
},
}

ghWebhookHandler := githubWebhookHandler{
Expand Down

0 comments on commit f20446e

Please sign in to comment.