outposts/ak: updater providers automatically every 150 seconds

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-05-11 01:07:26 +02:00
parent 788fd00390
commit 0f1cc86e71
3 changed files with 15 additions and 1 deletions

View File

@ -111,3 +111,14 @@ func (ac *APIController) startWSHealth() {
}
}
}
func (ac *APIController) startIntervalUpdater() {
logger := ac.logger.WithField("loop", "interval-updater")
ticker := time.NewTicker(time.Second * 150)
for ; true; <-ticker.C {
err := ac.Server.Refresh()
if err != nil {
logger.WithError(err).Debug("Failed to update")
}
}
}