Use a custom promisified setTimeout

This commit is contained in:
Schuyler Cebulskie
2017-11-19 13:47:04 -05:00
parent acf82f32c3
commit 26b28813a8
3 changed files with 15 additions and 5 deletions

View File

@@ -3,7 +3,6 @@ const EventEmitter = require('events');
const path = require('path');
const Util = require('../util/Util');
const { Error } = require('../errors');
const delayFor = require('util').promisify(setTimeout);
/**
* A self-contained shard created by the {@link ShardingManager}. Each one has a {@link ChildProcess} that contains
@@ -122,7 +121,7 @@ class Shard extends EventEmitter {
this.process.removeListener('exit', this._exitListener);
this.process.kill();
this._handleExit(false);
if (delay > 0) await delayFor(delay);
if (delay > 0) await Util.delayFor(delay);
return this.spawn(waitForReady);
}