mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00: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) {
|
||||
const controller = new AbortController();
|
||||
req.on('close', () => controller.abort());
|
||||
req.socket.on('close', hasError => {
|
||||
if (hasError) {
|
||||
controller.abort();
|
||||
}
|
||||
});
|
||||
return controller.signal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user