diff --git a/authentik/sources/ldap/models.py b/authentik/sources/ldap/models.py index 2b939e022..9c95c563d 100644 --- a/authentik/sources/ldap/models.py +++ b/authentik/sources/ldap/models.py @@ -7,7 +7,7 @@ from tempfile import NamedTemporaryFile, mkdtemp from typing import Optional from django.core.cache import cache -from django.db import models +from django.db import connection, models from django.utils.translation import gettext_lazy as _ from ldap3 import ALL, NONE, RANDOM, Connection, Server, ServerPool, Tls from ldap3.core.exceptions import LDAPException, LDAPInsufficientAccessRightsResult, LDAPSchemaError @@ -203,7 +203,7 @@ class LDAPSource(Source): """Redis lock for syncing LDAP to prevent multiple parallel syncs happening""" return Lock( cache.client.get_client(), - name=f"goauthentik.io/sources/ldap/sync-{self.slug}", + name=f"goauthentik.io/sources/ldap/sync{connection.schema_name}-{self.slug}", # Convert task timeout hours to seconds, and multiply times 3 # (see authentik/sources/ldap/tasks.py:54) # multiply by 3 to add even more leeway