Merge pull request #393 from Icinga/feature/history-ha

Sync history independent of HA
This commit is contained in:
Julian Brost 2021-11-03 14:17:14 +01:00 committed by GitHub
commit cd9e683faa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,6 +115,14 @@ func run() int {
sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP)
go func() {
logger.Info("Starting history sync")
if err := hs.Sync(ctx); err != nil && !utils.IsContextCanceled(err) {
logger.Fatalf("%+v", err)
}
}()
// Main loop
for {
hactx, cancelHactx := context.WithCancel(ctx)
@ -158,12 +166,6 @@ func run() int {
}
})
g.Go(func() error {
logger.Info("Starting history sync")
return hs.Sync(synctx)
})
g.Go(func() error {
logger.Info("Starting overdue sync")