Skip to content

Commit 22ab9c4

Browse files
committed
Address review comments
1 parent 75e555e commit 22ab9c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/dd-trace/src/debugger/devtools_client/source-maps.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ const self = module.exports = {
4444
//
4545
// Source: https://github.com/nodejs/node/blob/v18.20.6/lib/async_hooks.js#L312
4646
function cacheIt (key, value) {
47-
if (Date.now() > cacheTimerLastSet + 1_000) {
47+
const now = Date.now()
48+
if (now > cacheTimerLastSet + 1_000) {
4849
clearTimeout(cacheTimer)
4950
cacheTimer = setTimeout(function () {
5051
// Optimize for app boot, where a lot of reads might happen
5152
// Clear cache a few seconds after it was last used
5253
cache.clear()
5354
}, 10_000).unref()
54-
cacheTimerLastSet = Date.now()
55+
cacheTimerLastSet = now
5556
}
5657
cache.set(key, value)
5758
return value

0 commit comments

Comments
 (0)