1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-18 01:50:50 +00:00

Stop db GC from not making the server start

This commit is contained in:
Ash Keel 2021-12-06 12:22:54 +01:00
parent 29e5db09b3
commit 9c1b49183c
No known key found for this signature in database
GPG key ID: BAD8D93E7314ED3E

18
main.go
View file

@ -172,15 +172,17 @@ func main() {
}()
// Run garbage collection every once in a while
ticker := time.NewTicker(15 * time.Minute)
defer ticker.Stop()
for range ticker.C {
// Run DB garbage collection until it's done
var err error
for err == nil {
err = db.Client().RunValueLogGC(0.5)
go func() {
ticker := time.NewTicker(15 * time.Minute)
defer ticker.Stop()
for range ticker.C {
// Run DB garbage collection until it's done
var err error
for err == nil {
err = db.Client().RunValueLogGC(0.5)
}
}
}
}()
// Start HTTP server
failOnError(httpServer.Listen(), "HTTP server stopped")