mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
refactor(core): Remove slow LDAP query and unused telemetry event (#7068)
https://linear.app/n8n/issue/PAY-660
This commit is contained in:
parent
b8e06d245f
commit
95cb127dfa
|
@ -963,14 +963,6 @@ export class InternalHooks implements IInternalHooksClass {
|
|||
return this.telemetry.track('Ldap general sync finished', data);
|
||||
}
|
||||
|
||||
async onLdapUsersDisabled(data: {
|
||||
reason: 'ldap_update' | 'ldap_feature_deactivated';
|
||||
users: number;
|
||||
user_ids: string[];
|
||||
}): Promise<void> {
|
||||
return this.telemetry.track('Ldap users disabled', data);
|
||||
}
|
||||
|
||||
async onUserUpdatedLdapSettings(data: {
|
||||
user_id: string;
|
||||
loginIdAttribute: string;
|
||||
|
|
|
@ -104,14 +104,6 @@ export class LdapSync {
|
|||
role,
|
||||
);
|
||||
|
||||
if (usersToDisable.length) {
|
||||
void Container.get(InternalHooks).onLdapUsersDisabled({
|
||||
reason: 'ldap_update',
|
||||
users: usersToDisable.length,
|
||||
user_ids: usersToDisable,
|
||||
});
|
||||
}
|
||||
|
||||
Logger.debug('LDAP - Users processed', {
|
||||
created: usersToCreate.length,
|
||||
updated: usersToUpdate.length,
|
||||
|
|
|
@ -180,11 +180,6 @@ export const updateLdapConfig = async (ldapConfig: LdapConfig): Promise<void> =>
|
|||
const ldapUsers = await getLdapUsers();
|
||||
if (ldapUsers.length) {
|
||||
await deleteAllLdapIdentities();
|
||||
void Container.get(InternalHooks).onLdapUsersDisabled({
|
||||
reason: 'ldap_update',
|
||||
users: ldapUsers.length,
|
||||
user_ids: ldapUsers.map((user) => user.id),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,17 +195,7 @@ export const updateLdapConfig = async (ldapConfig: LdapConfig): Promise<void> =>
|
|||
* If it's the first run of this feature, all the default data is created in the database
|
||||
*/
|
||||
export const handleLdapInit = async (): Promise<void> => {
|
||||
if (!isLdapEnabled()) {
|
||||
const ldapUsers = await getLdapUsers();
|
||||
if (ldapUsers.length) {
|
||||
void Container.get(InternalHooks).onLdapUsersDisabled({
|
||||
reason: 'ldap_feature_deactivated',
|
||||
users: ldapUsers.length,
|
||||
user_ids: ldapUsers.map((user) => user.id),
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!isLdapEnabled()) return;
|
||||
|
||||
const ldapConfig = await getLdapConfig();
|
||||
|
||||
|
|
Loading…
Reference in a new issue