We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75e555e commit 22ab9c4Copy full SHA for 22ab9c4
packages/dd-trace/src/debugger/devtools_client/source-maps.js
@@ -44,14 +44,15 @@ const self = module.exports = {
44
//
45
// Source: https://github.com/nodejs/node/blob/v18.20.6/lib/async_hooks.js#L312
46
function cacheIt (key, value) {
47
- if (Date.now() > cacheTimerLastSet + 1_000) {
+ const now = Date.now()
48
+ if (now > cacheTimerLastSet + 1_000) {
49
clearTimeout(cacheTimer)
50
cacheTimer = setTimeout(function () {
51
// Optimize for app boot, where a lot of reads might happen
52
// Clear cache a few seconds after it was last used
53
cache.clear()
54
}, 10_000).unref()
- cacheTimerLastSet = Date.now()
55
+ cacheTimerLastSet = now
56
}
57
cache.set(key, value)
58
return value
0 commit comments