OLD | NEW |
1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package coordinator | 5 package coordinator |
6 | 6 |
7 import ( | 7 import ( |
8 "time" | 8 "time" |
9 | 9 |
| 10 gcps "cloud.google.com/go/pubsub" |
10 "github.com/golang/protobuf/proto" | 11 "github.com/golang/protobuf/proto" |
11 log "github.com/luci/luci-go/common/logging" | 12 log "github.com/luci/luci-go/common/logging" |
12 "github.com/luci/luci-go/common/retry" | 13 "github.com/luci/luci-go/common/retry" |
13 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1" | 14 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1" |
14 "golang.org/x/net/context" | 15 "golang.org/x/net/context" |
15 gcps "google.golang.org/cloud/pubsub" | |
16 ) | 16 ) |
17 | 17 |
18 // ArchivalPublisher is capable of publishing archival requests. | 18 // ArchivalPublisher is capable of publishing archival requests. |
19 type ArchivalPublisher interface { | 19 type ArchivalPublisher interface { |
20 // Publish publishes the supplied ArchiveTask. | 20 // Publish publishes the supplied ArchiveTask. |
21 Publish(context.Context, *logdog.ArchiveTask) error | 21 Publish(context.Context, *logdog.ArchiveTask) error |
22 | 22 |
23 // NewPublishIndex returns a new publish index. Each publish index is un
ique | 23 // NewPublishIndex returns a new publish index. Each publish index is un
ique |
24 // within its request. | 24 // within its request. |
25 NewPublishIndex() uint64 | 25 NewPublishIndex() uint64 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 log.Fields{ | 60 log.Fields{ |
61 log.ErrorKey: err, | 61 log.ErrorKey: err, |
62 "delay": d, | 62 "delay": d, |
63 }.Warningf(c, "Failed to publish task. Retrying...") | 63 }.Warningf(c, "Failed to publish task. Retrying...") |
64 }) | 64 }) |
65 } | 65 } |
66 | 66 |
67 func (p *pubsubArchivalPublisher) NewPublishIndex() uint64 { | 67 func (p *pubsubArchivalPublisher) NewPublishIndex() uint64 { |
68 return p.publishIndexFunc() | 68 return p.publishIndexFunc() |
69 } | 69 } |
OLD | NEW |