-
Notifications
You must be signed in to change notification settings - Fork 135
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
feat(vercel-kv): support ttl
for setItem
#269
Conversation
here we add new option 'ttl' both for driver setup config & for `set()` method. the interface & implementation took notes from existing redis driver.
β Live Preview ready!
|
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.
I like the default ttl options !
Right now, I've just replaced unstorage dependency for one of my NuxtJs project with a github branch based on this PR. I know that this kind of manual testing is not ideal, but currently this is the best approach I could came out with to verify that this code have worked. my project: https://papan-skor.vercel.app I verify that the new |
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!
ttl
for setItem
Codecov Report
@@ Coverage Diff @@
## main #269 +/- ##
==========================================
+ Coverage 76.55% 76.94% +0.39%
==========================================
Files 26 26
Lines 3169 3223 +54
Branches 473 473
==========================================
+ Hits 2426 2480 +54
Misses 742 742
Partials 1 1
|
here we add new option 'ttl' both for driver setup config & for
set()
method. the interface & implementation took notes from existing redis driver.π Linked issue
this resolve #266
β Type of change
π Description
I have implemented the proposal in #266 . To test it, I have run
pnpm vitest run --coverage
by giving my Vercel KV's credential, and the result shows that it has passed completely.However because it only uses existing Vercel KV's test suite, it shouldn't have tested the new key expiration functionality. And I'm not sure how I should create the test for this particular feature. I've looked into Redis driver test suite, but I couldn't find section for testing key expiration which I could follow. Maybe other maintainers could give me some pointer? @pi0 @Hebilicious
π Checklist