Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1924)

Unified Diff: appengine/tsmon/middleware.go

Issue 1838303002: Use native Pub/Sub library primitives. (Closed) Base URL: https://github.com/luci/luci-go@logdog-go1.6
Patch Set: Use "Topic" instead of "NewTopic" ... don't want to create :) Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/cmd/logdog_butler/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/tsmon/middleware.go
diff --git a/appengine/tsmon/middleware.go b/appengine/tsmon/middleware.go
index 8a24e5367d2a73ceadbca8f07a09d9222e7bebf1..5d45ab2f60ac6398898b84d1f4d614a1a5073156 100644
--- a/appengine/tsmon/middleware.go
+++ b/appengine/tsmon/middleware.go
@@ -17,7 +17,7 @@ import (
"github.com/luci/gae/service/info"
gaeauth "github.com/luci/luci-go/appengine/gaeauth/client"
"github.com/luci/luci-go/common/clock"
- "github.com/luci/luci-go/common/gcloud/pubsub"
+ gcps "github.com/luci/luci-go/common/gcloud/pubsub"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/tsmon"
"github.com/luci/luci-go/common/tsmon/monitor"
@@ -55,17 +55,17 @@ func initialize(c context.Context) error {
if i.IsDevAppServer() {
mon = monitor.NewDebugMonitor("")
} else {
- client := func(c context.Context) (*http.Client, error) {
- // Create an HTTP client with the default appengine service account.
- auth, err := gaeauth.Authenticator(c, pubsub.PublisherScopes, nil)
- if err != nil {
- return nil, err
- }
- return auth.Client()
+ // Create an HTTP client with the default appengine service account.
+ auth, err := gaeauth.Authenticator(c, gcps.PublisherScopes, nil)
+ if err != nil {
+ return err
+ }
+ client, err := auth.Client()
+ if err != nil {
+ return err
}
- var err error
- mon, err = monitor.NewPubsubMonitor(client, pubsubProject, pubsubTopic)
+ mon, err = monitor.NewPubsubMonitor(c, client, gcps.NewTopic(pubsubProject, pubsubTopic))
if err != nil {
return err
}
« no previous file with comments | « no previous file | client/cmd/logdog_butler/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698