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:
Antonio Román
2019-04-21 13:34:09 +02:00
committed by SpaceEEC
parent abd9d36816
commit 01c708bc75
4 changed files with 29 additions and 24 deletions

View File

@@ -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 } });
}
/**