fix mailbox removal
This commit is contained in:
@@ -143,6 +143,7 @@ async function main() {
|
||||
updateCLI();
|
||||
reconnectServers(config);
|
||||
}
|
||||
|
||||
removeExpiredMailboxes();
|
||||
}, 2000);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export class Mailbox implements Subscriber {
|
||||
}
|
||||
|
||||
get isExpired() {
|
||||
if (this.ws) return false;
|
||||
if (this.ws && this.ws.readyState == 1) return false;
|
||||
|
||||
const today = new Date();
|
||||
return this.expiryDate < today;
|
||||
|
||||
@@ -208,7 +208,6 @@ export function processMessage(
|
||||
|
||||
// MAILBOX
|
||||
export function removeExpiredMailboxes() {
|
||||
const today = new Date();
|
||||
mailboxes.forEach((mailbox) => {
|
||||
if (mailbox.isExpired) removeMailbox(mailbox);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user