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

Unified Diff: common/tsmon/monitor/pubsub.go

Issue 1610993002: LogDog: Add collector service implementation. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 11 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
Index: common/tsmon/monitor/pubsub.go
diff --git a/common/tsmon/monitor/pubsub.go b/common/tsmon/monitor/pubsub.go
index a7482821fca0a52959020bd9204486a830022c29..63d678a9b3ca0e34b0d0373334dd7557f0a45946 100644
--- a/common/tsmon/monitor/pubsub.go
+++ b/common/tsmon/monitor/pubsub.go
@@ -9,11 +9,12 @@ import (
"github.com/luci/luci-go/common/auth"
"github.com/luci/luci-go/common/gcloud/gcps"
"github.com/luci/luci-go/common/tsmon/types"
- "google.golang.org/cloud"
+ "golang.org/x/net/context"
"google.golang.org/cloud/pubsub"
)
type pubSubMonitor struct {
+ context.Context
ps gcps.PubSub
topic gcps.Topic
}
@@ -32,8 +33,9 @@ func NewPubsubMonitor(credentialPath string, project string, topic string) (Moni
}
return &pubSubMonitor{
dnj (Google) 2016/01/21 04:36:24 Change in response to Pub/Sub changes. "context.Ba
- ps: gcps.New(cloud.NewContext(project, httpClient)),
- topic: gcps.Topic(topic),
+ Context: context.Background(),
+ ps: gcps.New(httpClient, project),
+ topic: gcps.Topic(topic),
}, nil
}
@@ -49,6 +51,6 @@ func (m *pubSubMonitor) Send(cells []types.Cell, defaultTarget types.Target) err
return err
}
- _, err = m.ps.Publish(m.topic, &pubsub.Message{Data: data})
+ _, err = m.ps.Publish(m, m.topic, &pubsub.Message{Data: data})
return err
}

Powered by Google App Engine
This is Rietveld 408576698