From 35b890aadcf50217b7a85db8c1f9112076f32c32 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 2 Dec 2018 21:19:09 -0800 Subject: Do not show $DATABASE_URL warning when showing application info --- cli/cli.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cli') diff --git a/cli/cli.go b/cli/cli.go index 629367a..623b9bb 100644 --- a/cli/cli.go +++ b/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 -- cgit v1.2.3