mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-04 04:42:37 +02:00
enforce max jobs per hour
This commit is contained in:
parent
0b31585141
commit
d2e590956b
55 changed files with 123 additions and 60 deletions
|
|
@ -28,7 +28,7 @@ export async function getCopilotResponseStream(
|
|||
streamId: string;
|
||||
} | { billingError: string }> {
|
||||
await projectAuthCheck(projectId);
|
||||
await usageQuotaPolicy.assertAndConsume(projectId);
|
||||
await usageQuotaPolicy.assertAndConsumeProjectAction(projectId);
|
||||
|
||||
// Check billing authorization
|
||||
const authResponse = await authorizeUserAction({
|
||||
|
|
@ -38,7 +38,7 @@ export async function getCopilotResponseStream(
|
|||
return { billingError: authResponse.error || 'Billing error' };
|
||||
}
|
||||
|
||||
await usageQuotaPolicy.assertAndConsume(projectId);
|
||||
await usageQuotaPolicy.assertAndConsumeProjectAction(projectId);
|
||||
|
||||
// prepare request
|
||||
const request: z.infer<typeof CopilotAPIRequest> = {
|
||||
|
|
@ -70,7 +70,7 @@ export async function getCopilotAgentInstructions(
|
|||
agentName: string,
|
||||
): Promise<string | { billingError: string }> {
|
||||
await projectAuthCheck(projectId);
|
||||
await usageQuotaPolicy.assertAndConsume(projectId);
|
||||
await usageQuotaPolicy.assertAndConsumeProjectAction(projectId);
|
||||
|
||||
// Check billing authorization
|
||||
const authResponse = await authorizeUserAction({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue