diff --git a/index.ts b/index.ts index 08cde9e..c185688 100755 --- a/index.ts +++ b/index.ts @@ -119,7 +119,6 @@ async function main() { // CLI function updateCLI() { - return; console.clear(); console.log(Colors.bold.bgWhite("UNIVERSAL DECENTRALIZED NETWORK")); @@ -146,7 +145,7 @@ async function main() { } removeExpiredMailboxes(); - }, 2000); + }, 5000); // FINISH writeSuccess(`###\nstarted up ${new Date().toLocaleString()}`); diff --git a/package.json b/package.json index 18da94a..7edc03d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "udn", - "version": "1.0.0-beta15", + "version": "1.0.0-beta16", "description": "A websocket-based infrastructure for decentralized networks ", "bin": { "start": "index.ts" diff --git a/subscriptionHandler.ts b/subscriptionHandler.ts index feb1911..3e1ca4f 100644 --- a/subscriptionHandler.ts +++ b/subscriptionHandler.ts @@ -93,8 +93,6 @@ export class Mailbox implements Subscriber { send(message: string, _?: boolean, uuid?: string): void { this._ws?.send(message); - console.log(this.id, uuid, message, "sending"); - if (!uuid) return; this.messages.set(uuid, message); } diff --git a/websocket-handler.ts b/websocket-handler.ts index 6a3ff0e..454b297 100644 --- a/websocket-handler.ts +++ b/websocket-handler.ts @@ -100,6 +100,12 @@ export function connectServers(config: typeof defaultConfig): void { } export function reconnectServers(config: typeof defaultConfig): void { + config.connectedServers + .map(address => address.replace("ws", "http")) + .forEach(address => { + fetch(address); + }); + [...serversDisconnected.values()].forEach((address) => { connectServer(address, config); });