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

[Small] Switch from TTL to Redis time entry #7

Open
ItWasEnder opened this issue Aug 19, 2024 · 1 comment
Open

[Small] Switch from TTL to Redis time entry #7

ItWasEnder opened this issue Aug 19, 2024 · 1 comment

Comments

@ItWasEnder
Copy link

Currently, used_requests is stored in Redis with an expiration matching the user's subscription period_end. However, this approach lacks a method for tracking historical data unless we implemented heartbeats, which would be inefficient.

The proposed solution is to store the user's period_end in Redis. When this timestamp is <= now(), a historical entry should be added to a stats table in Supabase. Following this, the used_requests key in Redis would be reset to zero.

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

No branches or pull requests

2 participants