| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // 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 "github.com/golang/protobuf/proto" | 10 "github.com/golang/protobuf/proto" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 // TODO: Route this through some system (e.g., task queue, tumble) that
can | 36 // TODO: Route this through some system (e.g., task queue, tumble) that
can |
| 37 // impose a dispatch delay for the settle period. | 37 // impose a dispatch delay for the settle period. |
| 38 msg := gcps.Message{ | 38 msg := gcps.Message{ |
| 39 Data: d, | 39 Data: d, |
| 40 } | 40 } |
| 41 | 41 |
| 42 return retry.Retry(c, retry.Default, func() error { | 42 return retry.Retry(c, retry.Default, func() error { |
| 43 log.Fields{ | 43 log.Fields{ |
| 44 » » » "path": t.Path, | 44 » » » "project": t.Project, |
| 45 » » » "key": t.Key, | 45 » » » "path": t.Path, |
| 46 » » » "key": t.Key, |
| 46 }.Infof(c, "Publishing archival message for stream.") | 47 }.Infof(c, "Publishing archival message for stream.") |
| 47 | 48 |
| 48 _, err := p.topic.Publish(c, &msg) | 49 _, err := p.topic.Publish(c, &msg) |
| 49 return err | 50 return err |
| 50 }, func(err error, d time.Duration) { | 51 }, func(err error, d time.Duration) { |
| 51 log.Fields{ | 52 log.Fields{ |
| 52 log.ErrorKey: err, | 53 log.ErrorKey: err, |
| 53 "delay": d, | 54 "delay": d, |
| 54 }.Warningf(c, "Failed to publish task. Retrying...") | 55 }.Warningf(c, "Failed to publish task. Retrying...") |
| 55 }) | 56 }) |
| 56 } | 57 } |
| OLD | NEW |