File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ func (api *API) Register(r *route.Router) {
127
127
}
128
128
129
129
// Update sets the configuration string to a new value.
130
- func (api * API ) Update (cfg string , resolveTimeout time.Duration ) {
130
+ func (api * API ) Update (cfg string , resolveTimeout time.Duration ) error {
131
131
api .mtx .Lock ()
132
132
defer api .mtx .Unlock ()
133
133
@@ -137,8 +137,11 @@ func (api *API) Update(cfg string, resolveTimeout time.Duration) {
137
137
configJSON , err := config .Load (cfg )
138
138
if err != nil {
139
139
log .Errorf ("error: %v" , err )
140
+ return err
140
141
}
142
+
141
143
api .configJSON = * configJSON
144
+ return nil
142
145
}
143
146
144
147
type errorType string
Original file line number Diff line number Diff line change @@ -208,7 +208,10 @@ func main() {
208
208
return err
209
209
}
210
210
211
- apiv .Update (conf .String (), time .Duration (conf .Global .ResolveTimeout ))
211
+ err = apiv .Update (conf .String (), time .Duration (conf .Global .ResolveTimeout ))
212
+ if err != nil {
213
+ return err
214
+ }
212
215
213
216
tmpl , err = template .FromGlobs (conf .Templates ... )
214
217
if err != nil {
You can’t perform that action at this time.
0 commit comments