fix: use node-redis style TTL with factory adapter (fixes #16)#30
fix: use node-redis style TTL with factory adapter (fixes #16)#30mrjasonroy wants to merge 1 commit intomainfrom
Conversation
The RedisClient interface now uses node-redis style SET options
({ EX: seconds }) instead of ioredis positional args. The factory
adapter translates these to ioredis's positional format ("EX", seconds).
Fixes #16.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @mrjasonroy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Redis caching mechanism to standardize how Time-To-Live (TTL) values are passed to the Redis client. By adopting the node-redis style Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully refactors the Redis client interface and its usage to adopt a node-redis style for setting TTL (Time To Live) options. The RedisClient interface now expects an options object { EX: seconds } for its set method, which aligns with modern Redis client libraries. The createRedisAdapter function correctly translates these node-redis style options into ioredis positional arguments, ensuring backward compatibility with ioredis clients. The test suite has been thoroughly updated to reflect these changes, including modifications to the FakeRedis implementation and test expectations. This is a well-executed change that improves consistency and maintainability.
|
Closing in favor of pushing updates directly to #28 |
Summary
RedisClientinterface'sset()method to use node-redis style options ({ EX: seconds }) instead of ioredis positional argscreateRedisAdapter()to translate{ EX: seconds }to ioredis's"EX", secondsformatThis is a reworked version of #28 that properly handles the adapter layer. The original PR only changed
redis.tsbut didn't update the factory adapter, which would have broken TTL for users going throughcreateCacheHandler().Closes #16
Supersedes #28
Test plan
{ EX: seconds }style args🤖 Generated with Claude Code