Skip to content

Commit

Permalink
lib: fix ExpiringMap internal storage growing
Browse files Browse the repository at this point in the history
Internal storage of ExpiringMap used to store key deletion times was not
cleared after deleting corresponding keys, leading to its indefinite
growth.

Fixes: #413
PR-URL: #414
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Dmytro Nechai <nechaido@gmail.com>
  • Loading branch information
belochub committed Feb 8, 2019
1 parent 3f5d890 commit 700776e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class ExpiringMap extends Map {
this._deletionTimes.forEach((delTime, key) => {
if (purgeTime - delTime > this._interval) {
super.delete(key);
this._deletionTimes.delete(key);
}
});
}
Expand Down

0 comments on commit 700776e

Please sign in to comment.