Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
replace lrucache package with lru-cache (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-darkly authored Jun 15, 2021
1 parent 010a1a5 commit 3ae053a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions event_processor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const LRUCache = require('lrucache');
const LRUCache = require('lru-cache');
const { v4: uuidv4 } = require('uuid');

const EventSummarizer = require('./event_summarizer');
Expand Down Expand Up @@ -26,7 +26,7 @@ function EventProcessor(sdkKey, config, errorReporter, diagnosticsManager) {

const userFilter = UserFilter(config),
summarizer = EventSummarizer(config),
userKeysCache = LRUCache(config.userKeysCapacity),
userKeysCache = new LRUCache({ max: config.userKeysCapacity }),
mainEventsUri = config.eventsUri + '/bulk',
diagnosticEventsUri = config.eventsUri + '/diagnostic';

Expand Down Expand Up @@ -289,7 +289,7 @@ function EventProcessor(sdkKey, config, errorReporter, diagnosticsManager) {
}, config.flushInterval * 1000);

const flushUsersTimer = setInterval(() => {
userKeysCache.removeAll();
userKeysCache.reset();
}, config.userKeysFlushInterval * 1000);

ep.close = () => {
Expand Down
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"async": "^3.1.0",
"launchdarkly-eventsource": "1.4.1",
"lrucache": "^1.0.3",
"lru-cache": "^6.0.0",
"node-cache": "^5.1.0",
"semver": "^7.3.0",
"tunnel": "0.0.6",
Expand Down

0 comments on commit 3ae053a

Please sign in to comment.