add expiry date to mailbox

This commit is contained in:
marlon-erler
2024-07-08 19:51:56 +02:00
parent 81c01fb3c2
commit 49b4ed94f6
+7
View File
@@ -8,8 +8,15 @@ export interface Subscriber {
export class Mailbox implements Subscriber {
// basic
id = Crypto.randomUUID();
dateLastChecked = new Date();
messages = new Set<string>();
get expiryDate() {
const expiryDate = new Date(this.dateLastChecked);
expiryDate.setDate(expiryDate.getDate() + 7);
return expiryDate;
}
// websocket
_ws: WS | undefined;