Skip to content

Commit

Permalink
ensure the fiber clears _meteor_dynamics
Browse files Browse the repository at this point in the history
znewsham committed Jul 5, 2023
1 parent 0385a4f commit 1e00960
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
always-auth = true
registry = https://verdaccio.staging.qualia.io/
registry = https://verdaccio.prod-tools.qualia.io/
5 changes: 4 additions & 1 deletion fibers_async.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,10 @@ if (_Fiber.Fiber) {
const asyncResourceWeakMap = new WeakMap();
function Fiber(fn, ...args) {
const ar = new AsyncResource('Fiber');
const actualFn = (...args1) => ar.runInAsyncScope(() => fn(...args1));
const actualFn = (...args1) => ar.runInAsyncScope(() => {
Fiber.current._meteor_dynamics = undefined;
fn(...args1);
});
const _fiber = _Fiber(actualFn, ...args);
asyncResourceWeakMap.set(_fiber, ar);
return _fiber;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fibers",
"version": "5.0.2-5",
"version": "5.0.2-6",
"description": "Cooperative multi-tasking for Javascript",
"keywords": [
"fiber",

0 comments on commit 1e00960

Please sign in to comment.