mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +00:00
Stop db GC from not making the server start
This commit is contained in:
parent
29e5db09b3
commit
9c1b49183c
1 changed files with 10 additions and 8 deletions
18
main.go
18
main.go
|
@ -172,15 +172,17 @@ func main() {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Run garbage collection every once in a while
|
// Run garbage collection every once in a while
|
||||||
ticker := time.NewTicker(15 * time.Minute)
|
go func() {
|
||||||
defer ticker.Stop()
|
ticker := time.NewTicker(15 * time.Minute)
|
||||||
for range ticker.C {
|
defer ticker.Stop()
|
||||||
// Run DB garbage collection until it's done
|
for range ticker.C {
|
||||||
var err error
|
// Run DB garbage collection until it's done
|
||||||
for err == nil {
|
var err error
|
||||||
err = db.Client().RunValueLogGC(0.5)
|
for err == nil {
|
||||||
|
err = db.Client().RunValueLogGC(0.5)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}()
|
||||||
|
|
||||||
// Start HTTP server
|
// Start HTTP server
|
||||||
failOnError(httpServer.Listen(), "HTTP server stopped")
|
failOnError(httpServer.Listen(), "HTTP server stopped")
|
||||||
|
|
Loading…
Reference in a new issue