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 config | 5 package config |
6 | 6 |
7 import ( | 7 import ( |
8 "time" | 8 "time" |
9 | 9 |
10 "github.com/luci/luci-go/common/clock" | 10 "github.com/luci/luci-go/common/clock" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 "currentHash": lastHash, | 85 "currentHash": lastHash, |
86 }.Debugf(c, "Content hash matches.") | 86 }.Debugf(c, "Content hash matches.") |
87 } | 87 } |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 // Refresh reloads the configuration value, updating ContentHash. | 91 // Refresh reloads the configuration value, updating ContentHash. |
92 func (p *ChangePoller) Refresh(c context.Context) error { | 92 func (p *ChangePoller) Refresh(c context.Context) error { |
93 var meta cfgclient.Meta | 93 var meta cfgclient.Meta |
94 if err := cfgclient.Get(c, cfgclient.AsService, p.ConfigSet, p.Path, nil
, &meta); err != nil { | 94 if err := cfgclient.Get(c, cfgclient.AsService, p.ConfigSet, p.Path, nil
, &meta); err != nil { |
95 » » return errors.Annotate(err).Reason("failed to reload config %(co
nfigSet)s :: %(path)s"). | 95 » » return errors.Annotate(err, "failed to reload config %s :: %s",
p.ConfigSet, p.Path).Err() |
96 » » » D("configSet", p.ConfigSet). | |
97 » » » D("path", p.Path). | |
98 » » » Err() | |
99 } | 96 } |
100 | 97 |
101 p.ContentHash = meta.ContentHash | 98 p.ContentHash = meta.ContentHash |
102 return nil | 99 return nil |
103 } | 100 } |
OLD | NEW |