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

Unified Diff: logdog/server/cmd/logdog_archivist/main.go

Issue 2219023003: Update APIs to use new Google cloud paths. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 4 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: logdog/server/cmd/logdog_archivist/main.go
diff --git a/logdog/server/cmd/logdog_archivist/main.go b/logdog/server/cmd/logdog_archivist/main.go
index 918029c232d6e4e4ccb260509f0aea8dc0e3aca4..0790e8b86762d2f9c8b9d9af961c63411ef43ff1 100644
--- a/logdog/server/cmd/logdog_archivist/main.go
+++ b/logdog/server/cmd/logdog_archivist/main.go
@@ -22,9 +22,10 @@ import (
"github.com/luci/luci-go/logdog/api/config/svcconfig"
"github.com/luci/luci-go/logdog/server/archivist"
"github.com/luci/luci-go/logdog/server/service"
+
+ "cloud.google.com/go/pubsub"
"golang.org/x/net/context"
- "google.golang.org/cloud"
- "google.golang.org/cloud/pubsub"
+ "google.golang.org/api/option"
)
var (
@@ -91,16 +92,8 @@ func (a *application) runArchivist(c context.Context) error {
return err
}
- // Pub/Sub: HTTP Client => Context
- psHTTPClient, err := psAuth.Client()
- if err != nil {
- log.WithError(err).Errorf(c, "Failed to create authenticated Pub/Sub transport.")
- return err
- }
- psContext := cloud.WithContext(c, psProject, psHTTPClient)
-
// Pub/Sub: TokenSource => Client
- psClient, err := pubsub.NewClient(c, psProject, cloud.WithTokenSource(psAuth.TokenSource()))
+ psClient, err := pubsub.NewClient(c, psProject, option.WithTokenSource(psAuth.TokenSource()))
if err != nil {
log.WithError(err).Errorf(c, "Failed to create Pub/Sub client.")
return err
@@ -190,7 +183,7 @@ func (a *application) runArchivist(c context.Context) error {
tsTaskProcessingTime.Add(c, duration.Seconds()*1000, deleteTask)
}()
- task, err := makePubSubArchivistTask(psContext, psSubscriptionName, msg)
+ task, err := makePubSubArchivistTask(psSubscriptionName, msg)
if err != nil {
log.WithError(err).Errorf(c, "Failed to unmarshal archive task from message.")
deleteTask = true

Powered by Google App Engine
This is Rietveld 408576698