Change "close" connection event to "end"

This commit is contained in:
TheEssem 2021-05-23 17:22:31 -05:00
parent 9fd9464cc5
commit 32a470aec3
No known key found for this signature in database
GPG key ID: A3F9F02129092FCA

View file

@ -103,7 +103,7 @@ exports.connect = (server) => {
connection.on("error", (e) => { connection.on("error", (e) => {
logger.error(e.toString()); logger.error(e.toString());
}); });
connection.once("close", () => { connection.once("end", () => {
for (const uuid of Object.keys(this.jobs)) { for (const uuid of Object.keys(this.jobs)) {
if (this.jobs[uuid].addr === connection.remoteAddress) this.jobs[uuid].event.emit("error", "Job ended prematurely due to a closed connection; please run your image job again"); if (this.jobs[uuid].addr === connection.remoteAddress) this.jobs[uuid].event.emit("error", "Job ended prematurely due to a closed connection; please run your image job again");
} }