mirror of https://github.com/nodejs/node.git
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. PR-URL: https://github.com/nodejs/node/pull/34617 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
48249889b6
commit
a4e1755df2
|
@ -313,8 +313,8 @@ class AsyncLocalStorage {
|
|||
}
|
||||
|
||||
getStore() {
|
||||
const resource = executionAsyncResource();
|
||||
if (this.enabled) {
|
||||
const resource = executionAsyncResource();
|
||||
return resource[this.kResourceStore];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue