1
0
Fork 0

Do not show $DATABASE_URL warning when showing application info

This commit is contained in:
Frédéric Guillot 2018-12-02 21:19:09 -08:00
parent 1bc8535dbb
commit 35b890aadc

View file

@ -57,14 +57,6 @@ func Parse() {
logger.EnableDebug()
}
db, err := database.NewConnectionPool(cfg.DatabaseURL(), cfg.DatabaseMinConns(), cfg.DatabaseMaxConns())
if err != nil {
logger.Fatal("Unable to connect to the database: %v", err)
}
defer db.Close()
store := storage.NewStorage(db)
if flagInfo {
info()
return
@ -75,11 +67,19 @@ func Parse() {
return
}
db, err := database.NewConnectionPool(cfg.DatabaseURL(), cfg.DatabaseMinConns(), cfg.DatabaseMaxConns())
if err != nil {
logger.Fatal("Unable to connect to the database: %v", err)
}
defer db.Close()
if flagMigrate {
database.Migrate(db)
return
}
store := storage.NewStorage(db)
if flagResetFeedErrors {
store.ResetFeedErrors()
return