From eb9d2bc37391f9f8702fef449d6beee0193797a6 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Tue, 20 Jun 2023 15:51:33 +0200 Subject: [PATCH] dont connect ldap on startup Signed-off-by: jkoberg --- changelog/unreleased/dont-connect-ldap-on-startup.md | 5 +++++ services/graph/pkg/identity/ldap/reconnect.go | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/dont-connect-ldap-on-startup.md diff --git a/changelog/unreleased/dont-connect-ldap-on-startup.md b/changelog/unreleased/dont-connect-ldap-on-startup.md new file mode 100644 index 00000000000..52dcefa7fa3 --- /dev/null +++ b/changelog/unreleased/dont-connect-ldap-on-startup.md @@ -0,0 +1,5 @@ +Bugfix: Don't connect to ldap on startup + +This leads to misleading error messages. Instead we connect on first request + +https://github.com/owncloud/ocis/pull/6565 diff --git a/services/graph/pkg/identity/ldap/reconnect.go b/services/graph/pkg/identity/ldap/reconnect.go index 0a4e924743b..31525eea1e4 100644 --- a/services/graph/pkg/identity/ldap/reconnect.go +++ b/services/graph/pkg/identity/ldap/reconnect.go @@ -205,10 +205,10 @@ func (c ConnWithReconnect) GetConnection() (*ldap.Conn, error) { } func (c ConnWithReconnect) ldapAutoConnect(config Config) { - l, err := c.ldapConnect(config) - if err != nil { - c.logger.Error().Err(err).Msg("autoconnect could not get ldap Connection") - } + var ( + l *ldap.Conn + err error + ) for { select {