fix: adapt new abort behavior (#10622)

This commit is contained in:
darkskygit
2025-03-05 06:03:43 +00:00
parent 59de4558bd
commit 0b8fa7904d

View File

@@ -175,7 +175,11 @@ export class CopilotController implements BeforeApplicationShutdown {
private getSignal(req: Request) {
const controller = new AbortController();
req.on('close', () => controller.abort());
req.socket.on('close', hasError => {
if (hasError) {
controller.abort();
}
});
return controller.signal;
}