-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Update cache-handler-redis
example dependencies
#59458
Update cache-handler-redis
example dependencies
#59458
Conversation
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
useTtl, | ||
}) | ||
|
||
const localCache = createLruCache({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for redisCache and localCache enable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ezeparziale! If Redis fails, you can use it as a fallback instead of a slow file system. But if you use a shared file system setup, you should turn it off. I added a new section to the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for prompt reply!
I think this the best approach to run in k8s with some replicas is:
IncrementalCache.onCreation(async () => {
let redisCache, localCache;
const useTtl = true;
if (process.env.REDIS_AVAILABLE) {
await client.connect();
redisCache = await createRedisCache({
client,
useTtl,
});
localCache = createLruCache({
useTtl,
});
}
const cache = [redisCache, localCache];
return {
cache,
useFileSystem: false
};
});
e0e9ef1
to
da6f80c
Compare
Lint is failing here, could you address please? |
ce81958
to
ee849ba
Compare
Hi @leerob! I have rebased the branch and double-checked that |
This pull request updates the dependencies in the cache-handler-redis example. It updates the versions of the
@neshca/cache-handler
, which introduces new features.