Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[async_hooks] don't read resource if ALS is disabled
Only call executionAsyncResource() in getStore() if the ALS instance is
enabled because the resource is not needed otherwise.
  • Loading branch information
Flarna committed Aug 3, 2020
commit c9fc86656e4e528824eca57157215b38fd9834e3
2 changes: 1 addition & 1 deletion lib/async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ class AsyncLocalStorage {
}

getStore() {
const resource = executionAsyncResource();
if (this.enabled) {
const resource = executionAsyncResource();
return resource[this.kResourceStore];
}
}
Expand Down