Skip to content
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 updatedAt instead of overwriting createdAt #182

Closed
wants to merge 263 commits into from
Closed

Conversation

zackrw
Copy link
Contributor

@zackrw zackrw commented Nov 14, 2023

I noticed the existing approach updates createdAt with each vercel KV payload:

ss-2023-11-13-17 29 27

So I updated it to only set createdAt if the record doesn't exist yet:

ss-2023-11-13-17 28 01

(Coincidentally both values end in 902 here 🙂)

I didn't figure out how to do this in a single request, but that would be even better. I also added explicit types to get TS and Redis onboard with adding createdAt to the payload conditionally.

The other change I am suggesting is moving from hmset to hset. I think the behavior is the same but Redis says hmset is deprecated: https://redis.io/commands/hmset/ ... I may be missing something if that is intentional though.

Copy link

vercel bot commented Nov 14, 2023

@zackrw is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet