Nick: bucket limit increase

This commit is contained in:
Nicolas 2024-08-27 17:03:46 -03:00
parent f0dfcd6a49
commit ca34f1203b
2 changed files with 6 additions and 6 deletions

View File

@ -50,11 +50,11 @@ describe("Job Priority Tests", () => {
(redisConnection.scard as jest.Mock).mockResolvedValue(150);
const priority = await getJobPriority({ plan, team_id });
expect(priority).toBe(20);
expect(priority).toBe(10);
(redisConnection.scard as jest.Mock).mockResolvedValue(250);
const priorityExceeded = await getJobPriority({ plan, team_id });
expect(priorityExceeded).toBe(40); // basePriority + Math.ceil((250 - 200) * 0.2)
expect(priorityExceeded).toBe(20); // basePriority + Math.ceil((250 - 200) * 0.4)
});
test("getJobPriority should handle different plans correctly", async () => {
@ -68,7 +68,7 @@ describe("Job Priority Tests", () => {
(redisConnection.scard as jest.Mock).mockResolvedValue(150);
plan = "hobby";
priority = await getJobPriority({ plan, team_id });
expect(priority).toBe(40); // basePriority + Math.ceil((150 - 50) * 0.3)
expect(priority).toBe(25); // basePriority + Math.ceil((150 - 50) * 0.3)
(redisConnection.scard as jest.Mock).mockResolvedValue(25);
plan = "free";

View File

@ -53,17 +53,17 @@ export async function getJobPriority({
planModifier = 0.5;
break;
case "hobby":
bucketLimit = 50;
bucketLimit = 100;
planModifier = 0.3;
break;
case "standard":
case "standardnew":
bucketLimit = 100;
bucketLimit = 200;
planModifier = 0.2;
break;
case "growth":
case "growthdouble":
bucketLimit = 200;
bucketLimit = 400;
planModifier = 0.2;
break;