fix: monthly reset now updates reset_at correctly
Critical bug: usage limits were never resetting after first month because reset_at timestamp was not updated during ON CONFLICT UPDATE. This caused users to stay permanently blocked after reaching monthly limit once. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cd4d9124b0
commit
8415509f4c
|
|
@ -318,8 +318,9 @@ def increment_feature_usage(profile_id: str, feature_id: str) -> None:
|
|||
ON CONFLICT (profile_id, feature_id)
|
||||
DO UPDATE SET
|
||||
usage_count = user_feature_usage.usage_count + 1,
|
||||
reset_at = %s,
|
||||
updated = CURRENT_TIMESTAMP
|
||||
""", (profile_id, feature_id, next_reset))
|
||||
""", (profile_id, feature_id, next_reset, next_reset))
|
||||
|
||||
conn.commit()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user