-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
Hi guys
I used your library as a dependency of zipkin package.
And I spent 2 days and realized this context doesn't work with await at all
var createNamespace = require('continuation-local-storage').createNamespace;
var session = createNamespace('my session');
const fn = async () => {
console.log('before await => ', session.get('misha')); // before await => yo man
await Promise.resolve(1);
console.log('after await => ', session.get('misha')); // after await => undefined
};
(async () => {
session.run(async() => {
session.set('misha', 'yo man');
fn();
});
})();So if in my code there are awaits, and in enterprize there are a lot of awaits... then context will be lost just right after await.
v10.16.3 test in
Metadata
Metadata
Assignees
Labels
No labels