fix mailbox removal

This commit is contained in:
marlon-erler
2024-07-09 02:57:32 +02:00
parent 13e1e75e48
commit 72029a6923
3 changed files with 2 additions and 2 deletions
+1
View File
@@ -143,6 +143,7 @@ async function main() {
updateCLI(); updateCLI();
reconnectServers(config); reconnectServers(config);
} }
removeExpiredMailboxes(); removeExpiredMailboxes();
}, 2000); }, 2000);
+1 -1
View File
@@ -23,7 +23,7 @@ export class Mailbox implements Subscriber {
} }
get isExpired() { get isExpired() {
if (this.ws) return false; if (this.ws && this.ws.readyState == 1) return false;
const today = new Date(); const today = new Date();
return this.expiryDate < today; return this.expiryDate < today;
-1
View File
@@ -208,7 +208,6 @@ export function processMessage(
// MAILBOX // MAILBOX
export function removeExpiredMailboxes() { export function removeExpiredMailboxes() {
const today = new Date();
mailboxes.forEach((mailbox) => { mailboxes.forEach((mailbox) => {
if (mailbox.isExpired) removeMailbox(mailbox); if (mailbox.isExpired) removeMailbox(mailbox);
}); });