Skip to content

Commit 7f1eb0f

Browse files
committed
Children gone way too away early
1 parent 5f95a54 commit 7f1eb0f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-execution-context",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Provides execution context wrapper for node JS, can be used to create execution wrapper for handling requests and more",
55
"author": "Oded Goldglas <odedglas@gmail.com>",
66
"license": "ISC",

src/hooks/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const onChildProcessDestroy = (executionContextMap, asyncId, ref) => {
5858

5959
// Parent context will be released upon last child removal
6060
if (!children.length) {
61-
executionContextMap.delete(ref)
61+
suspend(() => executionContextMap.delete(ref));
6262

6363
return;
6464
}
@@ -91,7 +91,8 @@ const destroy = (executionContextMap) => (asyncId)=> {
9191
ref
9292
);
9393
}
94-
executionContextMap.delete(asyncId);
94+
95+
suspend(() => executionContextMap.delete(asyncId));
9596
};
9697

9798

0 commit comments

Comments
 (0)