Skip to content

Commit aaf8e0a

Browse files
committed
router: bypass the rate limiter for the initial commit
Previously the router would trigger the initial commit via the rate limiter. This change ensures the initial commit is triggered directly so the commit of the first sync can occur immediately.
1 parent 482b729 commit aaf8e0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/router/template/router.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ func newTemplateRouter(cfg templateRouterCfg) (*templateRouter, error) {
186186
return nil, err
187187
}
188188
glog.V(4).Infof("Committing state")
189-
router.Commit()
189+
// Bypass the rate limiter to ensure the first sync will be
190+
// committed without delay.
191+
router.commitAndReload()
190192
return router, nil
191193
}
192194

@@ -332,8 +334,6 @@ func (r *templateRouter) writeDefaultCert() error {
332334
}
333335

334336
func (r *templateRouter) readState() error {
335-
// Assume that state is read to ensure a subsequent commit will always be successful
336-
r.stateChanged = true
337337
data, err := ioutil.ReadFile(filepath.Join(r.dir, routeFile))
338338
// TODO: rework
339339
if err != nil {

0 commit comments

Comments
 (0)