summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Brackin <pbrackin@users.noreply.github.com>2019-01-20 01:30:37 -0800
committerzeripath <art27@cantab.net>2019-01-20 09:30:37 +0000
commitf63170229913b4ad32920391227ab774921272de (patch)
tree68b046fc6ac4e7e6a4324981d437ec71ac8129e2
parentdbb4aeead993a419f109a23c610d5e6d2b45697f (diff)
downloadgitea-f63170229913b4ad32920391227ab774921272de.tar.gz
gitea-f63170229913b4ad32920391227ab774921272de.zip
Ensure error is logged on db reconnection attempts (#5780)
Unfortunately a scoping problem was missed on the previous PR which meant that the only nil error was logged on failure to connect to the db. This pr fixes this.
-rw-r--r--routers/init.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/init.go b/routers/init.go
index 734aaaa131..4da786cc00 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -48,7 +48,7 @@ func initDBEngine() (err error) {
log.Info("Beginning ORM engine initialization.")
for i := 0; i < setting.DBConnectRetries; i++ {
log.Info("ORM engine initialization attempt #%d/%d...", i+1, setting.DBConnectRetries)
- if err := models.NewEngine(migrations.Migrate); err == nil {
+ if err = models.NewEngine(migrations.Migrate); err == nil {
break
} else if i == setting.DBConnectRetries-1 {
return err