zen: fix go plan usage limit
This commit is contained in:
@@ -654,12 +654,12 @@ export async function handler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check rolling limit
|
// Check rolling limit
|
||||||
if (sub.monthlyUsage && sub.timeMonthlyUpdated) {
|
if (sub.rollingUsage && sub.timeRollingUpdated) {
|
||||||
const result = Subscription.analyzeRollingUsage({
|
const result = Subscription.analyzeRollingUsage({
|
||||||
limit: liteData.rollingLimit,
|
limit: liteData.rollingLimit,
|
||||||
window: liteData.rollingWindow,
|
window: liteData.rollingWindow,
|
||||||
usage: sub.monthlyUsage,
|
usage: sub.rollingUsage,
|
||||||
timeUpdated: sub.timeMonthlyUpdated,
|
timeUpdated: sub.timeRollingUpdated,
|
||||||
})
|
})
|
||||||
if (result.status === "rate-limited")
|
if (result.status === "rate-limited")
|
||||||
throw new SubscriptionUsageLimitError(
|
throw new SubscriptionUsageLimitError(
|
||||||
|
|||||||
Reference in New Issue
Block a user