mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
feature: allow sweeping of inactive request buckets
This commit is contained in:
@@ -11,19 +11,6 @@ class BaseClient extends EventEmitter {
|
||||
constructor(options = {}) {
|
||||
super();
|
||||
|
||||
/**
|
||||
* The options the client was instantiated with
|
||||
* @type {ClientOptions}
|
||||
*/
|
||||
this.options = Util.mergeDefault(DefaultOptions, options);
|
||||
|
||||
/**
|
||||
* The REST manager of the client
|
||||
* @type {RESTManager}
|
||||
* @private
|
||||
*/
|
||||
this.rest = new RESTManager(this, options._tokenType);
|
||||
|
||||
/**
|
||||
* Timeouts set by {@link BaseClient#setTimeout} that are still active
|
||||
* @type {Set<Timeout>}
|
||||
@@ -37,6 +24,19 @@ class BaseClient extends EventEmitter {
|
||||
* @private
|
||||
*/
|
||||
this._intervals = new Set();
|
||||
|
||||
/**
|
||||
* The options the client was instantiated with
|
||||
* @type {ClientOptions}
|
||||
*/
|
||||
this.options = Util.mergeDefault(DefaultOptions, options);
|
||||
|
||||
/**
|
||||
* The REST manager of the client
|
||||
* @type {RESTManager}
|
||||
* @private
|
||||
*/
|
||||
this.rest = new RESTManager(this, options._tokenType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -468,6 +468,9 @@ class Client extends BaseClient {
|
||||
if (typeof options.restWsBridgeTimeout !== 'number' || isNaN(options.restWsBridgeTimeout)) {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'restWsBridgeTimeout', 'a number');
|
||||
}
|
||||
if (typeof options.restSweepInterval !== 'number' || isNaN(options.restSweepInterval)) {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'restSweepInterval', 'a number');
|
||||
}
|
||||
if (typeof options.internalSharding !== 'boolean') {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'internalSharding', 'a boolean');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user