Do not show $DATABASE_URL warning when showing application info
This commit is contained in:
parent
1bc8535dbb
commit
35b890aadc
1 changed files with 8 additions and 8 deletions
16
cli/cli.go
16
cli/cli.go
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue