Fixed DataStore, deprecation leftovers and a bit of Event Constants (#1841)

* Fixed leftover fetchThing and removed unused methods/error messages

* Added resume event constant and used event constants wherever possible

* Replaced mentions of removed method name with their new name.

* Fixed typo: resume -> resumed
This commit is contained in:
SpaceEEC
2017-08-28 00:11:28 +02:00
committed by Crawl
parent c4fecf6609
commit 65d9d46a3c
13 changed files with 22 additions and 32 deletions

View File

@@ -1,4 +1,5 @@
const Util = require('../util/Util');
const Constants = require('../util/Constants');
const { Error } = require('../errors');
/**
@@ -123,7 +124,7 @@ class ShardClientUtil {
_respond(type, message) {
this.send(message).catch(err => {
err.message = `Error when sending ${type} response to master process: ${err.message}`;
this.client.emit('error', err);
this.client.emit(Constants.Events.ERROR, err);
});
}
@@ -136,7 +137,8 @@ class ShardClientUtil {
if (!this._singleton) {
this._singleton = new this(client);
} else {
client.emit('warn', 'Multiple clients created in child process; only the first will handle sharding helpers.');
client.emit(Constants.Events.WARN,
'Multiple clients created in child process; only the first will handle sharding helpers.');
}
return this._singleton;
}