Clean up runNavidrome function

This commit is contained in:
Deluan
2024-05-09 07:42:40 -04:00
parent c4b05dac28
commit 885cd345ab
4 changed files with 41 additions and 20 deletions
+7 -1
View File
@@ -44,7 +44,7 @@ func Close() error {
return Db().Close()
}
func Init() {
func Init() func() {
db := Db()
// Disable foreign_keys to allow re-creating tables in migrations
@@ -74,6 +74,12 @@ func Init() {
if err != nil {
log.Fatal("Failed to apply new migrations", err)
}
return func() {
if err := Close(); err != nil {
log.Error("Error closing DB", err)
}
}
}
type statusLogger struct{ numPending int }