Derive the retained octets from ExpiringGroups' weight #36

Merged
lilleman merged 4 commits from reassembly-octets into main 2026-09-28 01:20:22 +02:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit b1a4201a7d - Show all commits
+2 -3
View File
@@ -54,10 +54,9 @@ export class ExpiringGroups<T> {
}
/** Starts the group's deadline, and the sweeper if this is the only group held. */
set(key: string, group: T, weight = 0): void {
set(key: string, group: T): void {
this.remove(key);
this.entries.set(key, { deadline: this.now() + this.timeout, group, weight });
this.total += weight;
this.entries.set(key, { deadline: this.now() + this.timeout, group, weight: 0 });
if (this.sweeper) return;
+2 -1
View File
@@ -106,7 +106,8 @@ export class HeldMessages {
this.log.warn('heldMessages - replacing a message on a re-used sequence number', { seqNr: Number(key) });
}
this.held.set(key, pduObjs, pduObjs.reduce((sum, pduObj) => sum + retainedOctets(pduObj), 0));
this.held.set(key, pduObjs);
this.held.weigh(key, pduObjs.reduce((sum, pduObj) => sum + retainedOctets(pduObj), 0));
return hold;
}