ACUC: Dynamic Limits (FIR-1641) (#1434)
* extend acuc definition * kill plan * stuff * stupid tests * feat: better acuc * feat(acuc): mock ACUC when not using db auth
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { authenticateUser } from "../auth";
|
||||
import {
|
||||
ConcurrencyCheckParams,
|
||||
ConcurrencyCheckResponse,
|
||||
RequestWithAuth,
|
||||
} from "./types";
|
||||
import { RateLimiterMode, PlanType } from "../../types";
|
||||
import { Response } from "express";
|
||||
import { redisConnection } from "../../services/queue-service";
|
||||
import { getConcurrencyLimitMax } from "../../services/rate-limiter";
|
||||
|
||||
// Basically just middleware and error wrapping
|
||||
export async function concurrencyCheckController(
|
||||
@@ -22,14 +19,9 @@ export async function concurrencyCheckController(
|
||||
Infinity,
|
||||
);
|
||||
|
||||
const maxConcurrency = getConcurrencyLimitMax(
|
||||
req.auth.plan as PlanType,
|
||||
req.auth.team_id,
|
||||
);
|
||||
|
||||
return res.status(200).json({
|
||||
success: true,
|
||||
concurrency: activeJobsOfTeam.length,
|
||||
maxConcurrency: maxConcurrency,
|
||||
maxConcurrency: req.acuc.concurrency,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user