vspd: Ensure backup loop runs forever.

Fixing a bug where the backup loop was not a loop - it was only running
one time.
This commit is contained in:
jholdstock 2023-09-18 17:34:54 +01:00 committed by Jamie Holdstock
parent b8cc99e4b6
commit d10e7daf74

View File

@ -128,6 +128,7 @@ func run() int {
// Periodically write a database backup file.
shutdownWg.Add(1)
go func() {
for {
select {
case <-ctx.Done():
shutdownWg.Done()
@ -138,6 +139,7 @@ func run() int {
log.Errorf("Failed to write database backup: %v", err)
}
}
}
}()
// Wait for shutdown tasks to complete before running deferred tasks and