Always initialize database after --config
Previously, this would only run when configuring an instance for single-user usage. Now it'll also run when configuring for multi-user usage. It also adds a log when the database has already been initialized.
This commit is contained in:
parent
a102f97c3e
commit
8d9f60aaa9
4
app.go
4
app.go
|
@ -449,7 +449,6 @@ func DoConfig(app *App) {
|
||||||
log.Error("Unable to configure: %v", err)
|
log.Error("Unable to configure: %v", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if d.User != nil {
|
|
||||||
app.cfg = d.Config
|
app.cfg = d.Config
|
||||||
connectToDatabase(app)
|
connectToDatabase(app)
|
||||||
defer shutdown(app)
|
defer shutdown(app)
|
||||||
|
@ -460,8 +459,11 @@ func DoConfig(app *App) {
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.Info("Database already initialized.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if d.User != nil {
|
||||||
u := &User{
|
u := &User{
|
||||||
Username: d.User.Username,
|
Username: d.User.Username,
|
||||||
HashedPass: d.User.HashedPass,
|
HashedPass: d.User.HashedPass,
|
||||||
|
|
Loading…
Reference in New Issue