Clean up runNavidrome function
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user