Chromium Code Reviews| 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 |
| } |