who knows :-3

This commit is contained in:
dumbmoron 2024-06-14 21:37:46 +00:00
parent 2ab1a01e91
commit 5834c714cf
No known key found for this signature in database

View File

@ -78,16 +78,25 @@ export function createInternalStream(url, obj = {}) {
}
const streamID = nanoid();
const controller = new AbortController();
internalStreamCache[streamID] = {
url,
service: obj.service,
headers: obj.headers,
controller: new AbortController(),
controller,
dispatcher
};
let streamLink = new URL('/api/istream', `http://127.0.0.1:${env.apiPort}`);
streamLink.searchParams.set('id', streamID);
const cleanup = () => {
destroyInternalStream(streamLink);
controller.signal.removeEventListener('abort', cleanup);
}
controller.signal.addEventListener('abort', cleanup);
return streamLink.toString();
}