Skip to content

Commit

Permalink
don't connect ldap on startup
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Jun 21, 2023
1 parent dd630b4 commit c78b5cb
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 c78b5cb

Please sign in to comment.