mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 15:26:59 +08:00
fix: adapt new abort behavior (#10622)
This commit is contained in:
@@ -175,7 +175,11 @@ export class CopilotController implements BeforeApplicationShutdown {
|
|||||||
|
|
||||||
private getSignal(req: Request) {
|
private getSignal(req: Request) {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
req.on('close', () => controller.abort());
|
req.socket.on('close', hasError => {
|
||||||
|
if (hasError) {
|
||||||
|
controller.abort();
|
||||||
|
}
|
||||||
|
});
|
||||||
return controller.signal;
|
return controller.signal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user