bug: cleanup subs

This commit is contained in:
Kieran 2023-03-29 15:17:12 +01:00
parent 8462a7c04f
commit 01d5e01a89
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 4 additions and 3 deletions

View File

@ -92,6 +92,9 @@ export class Query {
for (const c of this.#sentToRelays) {
c.CloseReq(this.id);
}
for (const sq of this.subQueries) {
sq.sendClose();
}
}
eose(sub: string, relay: string) {

View File

@ -313,9 +313,7 @@ export class NostrSystem {
let changed = false;
for (const [k, v] of this.Queries) {
if (v.closingAt && v.closingAt < now) {
if (v.leaveOpen) {
v.sendClose();
}
v.sendClose();
this.Queries.delete(k);
this.Feeds.delete(k);
console.debug("Removed:", k);