mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
feat(Sharding): change waitForReady to spawnTimeout (#3080)
This means that you'll not only be able to choose between having a timeout or not, but also to set the amount of milliseconds as you wish.
This commit is contained in:
@@ -143,12 +143,13 @@ class ShardClientUtil {
|
||||
* @param {number} [shardDelay=5000] How long to wait between shards (in milliseconds)
|
||||
* @param {number} [respawnDelay=500] How long to wait between killing a shard's process/worker and restarting it
|
||||
* (in milliseconds)
|
||||
* @param {boolean} [waitForReady=true] Whether to wait for a shard to become ready before continuing to another
|
||||
* @param {number} [spawnTimeout=30000] The amount in milliseconds to wait for a shard to become ready before
|
||||
* continuing to another. (-1 or Infinity for no wait)
|
||||
* @returns {Promise<void>} Resolves upon the message being sent
|
||||
* @see {@link ShardingManager#respawnAll}
|
||||
*/
|
||||
respawnAll(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
|
||||
return this.send({ _sRespawnAll: { shardDelay, respawnDelay, waitForReady } });
|
||||
respawnAll(shardDelay = 5000, respawnDelay = 500, spawnTimeout = 30000) {
|
||||
return this.send({ _sRespawnAll: { shardDelay, respawnDelay, spawnTimeout } });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user