None of these were needed in the first place

This commit is contained in:
TheEssem 2021-05-11 12:11:54 -05:00
parent 42188ee6d4
commit d5c7b38b57
No known key found for this signature in database
GPG key ID: A3F9F02129092FCA

View file

@ -99,7 +99,6 @@ exports.connect = (server) => {
for (const uuid of Object.keys(jobs)) {
if (jobs[uuid].addr === connection.remoteAddress) jobs[uuid].event.emit("error", new Error("Job ended prematurely due to a closed connection; please run your image job again"));
}
this.connections = this.connections.filter((val) => val.remoteAddress !== connection.remoteAddress);
});
this.connections.push(connection);
resolve();
@ -131,12 +130,7 @@ const getIdeal = () => {
}, 5000);
for (const connection of this.connections) {
if (!connection.remoteAddress) continue;
let promise = new Promise((resolveTest) => { resolveTest(); });
if (connection.destroyed) {
this.connections = this.connections.filter((val) => val.remoteAddress !== connection.remoteAddress);
promise = this.connect(connection.remoteAddress);
}
promise.then(() => fetch(`http://${connection.remoteAddress}:8081/status`)).then(statusRequest => statusRequest.text()).then(async (status) => {
fetch(`http://${connection.remoteAddress}:8081/status`).then(statusRequest => statusRequest.text()).then(async (status) => {
serversLeft--;
idealServers.push({
addr: connection.remoteAddress,