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); (redisConnection.scard as jest.Mock).mockResolvedValue(150);
const priority = await getJobPriority({ plan, team_id }); const priority = await getJobPriority({ plan, team_id });
expect(priority).toBe(20); expect(priority).toBe(10);
(redisConnection.scard as jest.Mock).mockResolvedValue(250); (redisConnection.scard as jest.Mock).mockResolvedValue(250);
const priorityExceeded = await getJobPriority({ plan, team_id }); 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 () => { test("getJobPriority should handle different plans correctly", async () => {
@ -68,7 +68,7 @@ describe("Job Priority Tests", () => {
(redisConnection.scard as jest.Mock).mockResolvedValue(150); (redisConnection.scard as jest.Mock).mockResolvedValue(150);
plan = "hobby"; plan = "hobby";
priority = await getJobPriority({ plan, team_id }); 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); (redisConnection.scard as jest.Mock).mockResolvedValue(25);
plan = "free"; plan = "free";

View File

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