<commit_before>const Syncer = require('./Syncer');
const LDAPSyncer = require('./LDAPSyncer');

/**
 * Implements syncing from multiple LDAP servers based on the Syncer interface
 * @class LDAPSystemSyncer
 * @implements {Syncer}
 */
class LDAPSystemSyncer extends Syncer {
	constructor(app, stats, logger) {
		super(app, stats, logger);
		Object.assign(this.stats, {
			systems: {},
		});
	}

	/**
     * @see {Syncer#respondsTo}
     */
	static respondsTo(target) {
		return target === 'ldap';
	}

	static params(params, data) {
		return [true];
	}

	/**
     * @see {Syncer#steps}
     */
	async steps() {
		await super.steps();
		const systems = await this.getSystems();
		const jobs = systems.map(async (system) => {
			this.stats.systems[system.alias] = {};
			await new LDAPSyncer(this.app, this.stats.systems[system.alias], this.logger, system).sync();
			await this.app.service('ldap').disconnect(system.ldapConfig);
		});
		return Promise.all(jobs);<commit_msg>Only sync one system at a time<commit_after>const Syncer = require('./Syncer');
const LDAPSyncer = require('./LDAPSyncer');

/**
 * Implements syncing from multiple LDAP servers based on the Syncer interface
 * @class LDAPSystemSyncer
 * @implements {Syncer}
 */
class LDAPSystemSyncer extends Syncer {
	constructor(app, stats, logger) {
		super(app, stats, logger);
		Object.assign(this.stats, {
			systems: {},
		});
	}

	/**
     * @see {Syncer#respondsTo}
     */
	static respondsTo(target) {
		return target === 'ldap';
	}

	static params(params, data) {
		return [true];
	}

	/**
     * @see {Syncer#steps}
     */
	async steps() {
		await super.steps();
		const systems = await this.getSystems();
		const jobs = systems.map((system) => async () => {
			this.stats.systems[system.alias] = {};
			await new LDAPSyncer(this.app, this.stats.systems[system.alias], this.logger, system).sync();
			await this.app.service('ldap').disconnect(system.ldapConfig);
		});
		for (const job of jobs) {
			await job();
		}
{'fraction_non_alphanumeric': 0.16070528967254408, 'fraction_numerical': 0.0, 'mean_word_length': 3.751196172248804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3394159', 'n_tokens_mistral': 715, 'n_tokens_neox': 661, 'n_words': 150}