mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-20 15:06:36 +00:00
feat: add periodic quota reset for API Key accounts
Support daily/weekly automatic quota reset using a rolling period anchored to first usage. Implements lazy reset via atomic CTE SQL in IncrementQuotaUsed - no cron job needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
da99de82e9
commit
e976409ba1
15 files changed
+172
-22
No files matched your search
@@ -176,7 +176,7 @@ func (m *mockAccountRepoForGemini) BulkUpdate(ctx context.Context, ids []int64,
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func (m *mockAccountRepoForGemini) IncrementQuotaUsed(ctx context.Context, id int64, amount float64) error {
|
||||
func (m *mockAccountRepoForGemini) IncrementQuotaUsed(ctx context.Context, id int64, amount float64, _ string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user