Skip to content

Commit f631702

Browse files
pbrackinzeripath
authored andcommitted
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.
1 parent dbb4aee commit f631702

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func initDBEngine() (err error) {
4848
log.Info("Beginning ORM engine initialization.")
4949
for i := 0; i < setting.DBConnectRetries; i++ {
5050
log.Info("ORM engine initialization attempt #%d/%d...", i+1, setting.DBConnectRetries)
51-
if err := models.NewEngine(migrations.Migrate); err == nil {
51+
if err = models.NewEngine(migrations.Migrate); err == nil {
5252
break
5353
} else if i == setting.DBConnectRetries-1 {
5454
return err

0 commit comments

Comments
 (0)