File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -113,9 +113,13 @@ func (db *DBTask) RunInit(ctx context.Context) error {
113113 defer cancel ()
114114 if err := postgres .Ping (); err == nil {
115115 ok = true
116+ logrus .WithFields (logrus.Fields {"attempt" : errcnt }).Info ("Connected to postgres database." )
116117 cancel ()
118+ } else if errcnt < maxAttempts - 1 {
119+ logrus .WithFields (logrus.Fields {"attempt" : errcnt }).Warn ("Could not connect to postgres database. Another attempt is scheduled." )
120+ } else {
121+ logrus .WithFields (logrus.Fields {"attempt" : errcnt }).Warn ("Could not connect to postgres database." )
117122 }
118- logrus .WithFields (logrus.Fields {"attempt" : errcnt }).Warn ("Could not connect to postgres database. Retrying." )
119123 // blocks until success, timeout, or ctx.Done()
120124 select {
121125 case <- wait .Done ():
You can’t perform that action at this time.
0 commit comments