Skip to content

Commit

Permalink
fix(troika-worker-utils): properly track open requests count
Browse files Browse the repository at this point in the history
  • Loading branch information
lojjic committed Feb 1, 2021
1 parent 10289dd commit a01d903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/troika-worker-utils/src/WorkerModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function getWorker(workerId) {
throw new Error('WorkerModule response with empty or unknown messageId')
}
delete openRequests[msgId]
openRequests.count--
openRequests._count--
callback(response)
}
}
Expand All @@ -165,7 +165,7 @@ function callWorker(workerId, action, data) {
}
}
openRequests._count++
if (openRequests.count > 1000) { //detect leaks
if (openRequests._count > 1000) { //detect leaks
console.warn('Large number of open WorkerModule requests, some may not be returning')
}
getWorker(workerId).postMessage({
Expand Down

0 comments on commit a01d903

Please sign in to comment.