-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use one instance of NodeCache per DB collection... #306
Comments
Can I work on this? |
From what i understood, this is what youre asking for: const nodeCache1 = new NodeCache( {
stdTTL: 600, // TTL for nodeCache1
checkperiod: 100,
});
const nodeCache2 = new NodeCache( {
stdTTL: 400, // TTL for nodeCache2
checkperiod: 100,
});
// . . .
nodeCache2.on( "key_expired", (key, value) => {
// . . .
});
nodeCache1.on( "key_expired", (key, value) => {
// . . .
}); And, yes thats possible |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to use the TTL at NodeCache's instance level and not per record.
Then I'll be notified only once when the instance data is expired and I will reload ALL the cache at once.
When instance is created, the TTL provided is applied to the instance
This notification should be called only once after instance expiration and I will put the code here to reload the whole cache:
Is it possible?
The text was updated successfully, but these errors were encountered: