Skip to content

Commit

Permalink
fix(domain): 清理domain的时候,移除挂载在domain的context (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinzZH authored Aug 23, 2023
1 parent f0b72fa commit 7d2e08e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core/runtime/create-server.hack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ export const hack = <T extends typeof http.createServer>(
d.remove(req);
d.remove(res);

if (process.domain.currentContext) {
process.domain.currentContext = null;
}

const parser = (req.socket as any).parser as any;
if (parser && parser.domain) {
(parser.domain as domain.Domain).exit();
Expand Down

0 comments on commit 7d2e08e

Please sign in to comment.