Skip to content

Commit

Permalink
Fix incompatibility with Electron renderer process (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaatt committed May 4, 2020
1 parent 6c5f5d5 commit 4b2cf8f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,14 @@ class CacheableLookup {

this._tickLocked = true;

setTimeout(() => {
const timeout = setTimeout(() => {
this._tickLocked = false;
}, this._lockTime).unref();
}, this._lockTime);

// There is no `timeout.unref()` when running inside an Electron renderer
if (timeout.unref) {
timeout.unref();
}
}

install(agent) {
Expand Down

0 comments on commit 4b2cf8f

Please sign in to comment.