fix: unify stream cleanup and async request ownership
This commit is contained in:
1 parent
9b165a8971
commit
fb39af6c28
13 files changed
+667
-461
No files matched your search
@@ -43,11 +43,12 @@ export function sseResponse(
|
||||
closed = true;
|
||||
clearInterval(heartbeat);
|
||||
signal.removeEventListener('abort', onAbort);
|
||||
cleanups.splice(0).forEach(cleanup);
|
||||
|
||||
if (closeStream) {
|
||||
controller.close();
|
||||
}
|
||||
|
||||
cleanups.splice(0).forEach(cleanup);
|
||||
};
|
||||
|
||||
const onAbort = () => teardown();
|
||||
|
||||
Reference in new issue
Block a user