Skip to content

Commit

Permalink
feat(tracking): Change startup to match cpus
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Crespi committed Mar 31, 2020
1 parent b5a7dff commit 5420487
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/invites/services/Tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import chalk from 'chalk';
import { AnyChannel, Guild, GuildAuditLog, GuildChannel, Invite, Member, Role, TextChannel } from 'eris';
import i18n from 'i18n';
import moment from 'moment';
import os from 'os';

import { GuildSettingsKey } from '../../framework/models/GuildSetting';
import { JoinInvalidatedReason } from '../../framework/models/Join';
import { IMService } from '../../framework/services/Service';
import { BasicMember, GuildPermission } from '../../types';
import { deconstruct } from '../../util';

const GUILDS_IN_PARALLEL = 10;
const GUILDS_IN_PARALLEL = os.cpus().length;
const INVITE_CREATE = 40;

export class TrackingService extends IMService {
Expand All @@ -30,6 +31,8 @@ export class TrackingService extends IMService {
this.client.on('guildRoleDelete', this.onGuildRoleDelete.bind(this));
this.client.on('guildMemberAdd', this.onGuildMemberAdd.bind(this));
this.client.on('guildMemberRemove', this.onGuildMemberRemove.bind(this));

console.log(`Requesting ${chalk.blue(GUILDS_IN_PARALLEL)} guilds in parallel during startup`);
}

public async onClientReady() {
Expand Down

0 comments on commit 5420487

Please sign in to comment.