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:
parent
b8cc99e4b6
commit
d10e7daf74
@ -128,6 +128,7 @@ func run() int {
|
|||||||
// Periodically write a database backup file.
|
// Periodically write a database backup file.
|
||||||
shutdownWg.Add(1)
|
shutdownWg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
shutdownWg.Done()
|
shutdownWg.Done()
|
||||||
@ -138,6 +139,7 @@ func run() int {
|
|||||||
log.Errorf("Failed to write database backup: %v", err)
|
log.Errorf("Failed to write database backup: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Wait for shutdown tasks to complete before running deferred tasks and
|
// Wait for shutdown tasks to complete before running deferred tasks and
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user