None of these were needed in the first place
This commit is contained in:
parent
42188ee6d4
commit
d5c7b38b57
1 changed files with 1 additions and 7 deletions
|
@ -99,7 +99,6 @@ exports.connect = (server) => {
|
||||||
for (const uuid of Object.keys(jobs)) {
|
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"));
|
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);
|
this.connections.push(connection);
|
||||||
resolve();
|
resolve();
|
||||||
|
@ -131,12 +130,7 @@ const getIdeal = () => {
|
||||||
}, 5000);
|
}, 5000);
|
||||||
for (const connection of this.connections) {
|
for (const connection of this.connections) {
|
||||||
if (!connection.remoteAddress) continue;
|
if (!connection.remoteAddress) continue;
|
||||||
let promise = new Promise((resolveTest) => { resolveTest(); });
|
fetch(`http://${connection.remoteAddress}:8081/status`).then(statusRequest => statusRequest.text()).then(async (status) => {
|
||||||
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) => {
|
|
||||||
serversLeft--;
|
serversLeft--;
|
||||||
idealServers.push({
|
idealServers.push({
|
||||||
addr: connection.remoteAddress,
|
addr: connection.remoteAddress,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue