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

Unified Diff: logdog/appengine/coordinator/archivalPublisher.go

Issue 2582253002: logdog: Use gRPC credentials when creating PubSub client, not http.Client. (Closed)
Patch Set: clear gRPC metadata as a precation Created 4 years 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 | logdog/appengine/coordinator/coordinatorTest/archival.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/appengine/coordinator/archivalPublisher.go
diff --git a/logdog/appengine/coordinator/archivalPublisher.go b/logdog/appengine/coordinator/archivalPublisher.go
index 68b5343ed4396ab6fb68486963bb57d0a96d2a48..fd17b34a8b37f5ada8b9c3b114186c87c9e0ef34 100644
--- a/logdog/appengine/coordinator/archivalPublisher.go
+++ b/logdog/appengine/coordinator/archivalPublisher.go
@@ -17,6 +17,9 @@ import (
// ArchivalPublisher is capable of publishing archival requests.
type ArchivalPublisher interface {
+ // Close shutdowns this publisher, releasing all its resources.
+ Close() error
+
// Publish publishes the supplied ArchiveTask.
Publish(context.Context, *logdog.ArchiveTask) error
@@ -26,6 +29,9 @@ type ArchivalPublisher interface {
}
type pubsubArchivalPublisher struct {
+ // client is Pub/Sub client used by the publisher.
+ client *gcps.Client
+
// topic is the authenticated Pub/Sub topic handle to publish to.
topic *gcps.Topic
@@ -34,6 +40,10 @@ type pubsubArchivalPublisher struct {
publishIndexFunc func() uint64
}
+func (p *pubsubArchivalPublisher) Close() error {
+ return p.client.Close()
+}
+
func (p *pubsubArchivalPublisher) Publish(c context.Context, t *logdog.ArchiveTask) error {
d, err := proto.Marshal(t)
if err != nil {
« no previous file with comments | « no previous file | logdog/appengine/coordinator/coordinatorTest/archival.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698