Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61683e1

Browse filesBrowse files
Flarnaaddaleax
authored andcommitted
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: #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>
1 parent 35ff592 commit 61683e1
Copy full SHA for 61683e1

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎lib/async_hooks.js‎

Copy file name to clipboardExpand all lines: lib/async_hooks.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ class AsyncLocalStorage {
277277
}
278278

279279
getStore() {
280-
const resource = executionAsyncResource();
281280
if (this.enabled) {
281+
const resource = executionAsyncResource();
282282
return resource[this.kResourceStore];
283283
}
284284
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.