Fix EOSE handling

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle
2023-11-07 20:48:56 +07:00
parent 94676ad472
commit db94aa162a
2 changed files with 2 additions and 2 deletions

View File

@@ -138,7 +138,7 @@ function newConn(addr) {
reqLimit.set(subID, remainingEvents);
}
if (!remainingEvents) {
if (remainingEvents < 1) {
// Once there are no remaining event, Do the instructed above.
csess.get(cID)?.send(JSON.stringify(["EOSE", sID]));
pendingEOSE.delete(subID);

View File

@@ -147,7 +147,7 @@ function newConn(addr, id) {
reqLimit.set(subID, remainingEvents);
}
if (!remainingEvents) {
if (remainingEvents < 1) {
// Once there are no remaining event, Do the instructed above.
csess.get(id)?.send(JSON.stringify(["EOSE", data[1]]));
pendingEOSE.delete(subID);