Skip to content

Commit

Permalink
Merge pull request #4003 from kobergj/DontConnectLdapOnStartup
Browse files Browse the repository at this point in the history
Don't connect to ldap on startup
  • Loading branch information
kobergj authored Jun 21, 2023
2 parents dd630b4 + c78b5cb commit a4c9718
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/dont-connect-ldap-on-startup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Don't connect ldap on startup

This leads to misleading error messages. Instead connect on first request.

https://github.com/cs3org/reva/pull/4003
10 changes: 5 additions & 5 deletions pkg/utils/ldap/reconnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ func (c *ConnWithReconnect) getConnection() (*ldap.Conn, error) {
}

func (c *ConnWithReconnect) ldapAutoConnect(config Config) {
l, err := c.ldapConnect(config)
if err != nil {
c.logger.Debug().Err(err).Msg("autoconnect could not get ldap Connection")
}
var (
l *ldap.Conn
err error
)

for {
select {
Expand Down Expand Up @@ -203,7 +203,7 @@ func (c *ConnWithReconnect) ldapConnect(config Config) (*ldap.Conn, error) {
}

if err != nil {
c.logger.Debug().Err(err).Msg("could not get ldap Connection")
c.logger.Error().Err(err).Msg("could not get ldap Connection")
return nil, err
}
c.logger.Debug().Msg("LDAP Connected")
Expand Down

0 comments on commit a4c9718

Please sign in to comment.