mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Merge pull request #393 from Icinga/feature/history-ha
Sync history independent of HA
This commit is contained in:
commit
cd9e683faa
1 changed files with 8 additions and 6 deletions
|
|
@ -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")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue