Skip to content

Commit

Permalink
Increase evaluation and generator cache time (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Antony1060 authored Nov 15, 2024
1 parent c119471 commit cd0932d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion apps/backend/src/lib/pendingSubmission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const storePendingSubmission = async (
RedisKeys.PENDING_SUBMISSION(meta.userId, meta.problemId, submission.id),
convertToPlainRedis(submission)
).then(() => {
Redis.expire(RedisKeys.PENDING_SUBMISSION(meta.userId, meta.problemId, submission.id), 60);
Redis.expire(
RedisKeys.PENDING_SUBMISSION(meta.userId, meta.problemId, submission.id),
5 * 60
);
});
};

Expand Down
6 changes: 3 additions & 3 deletions apps/backend/src/lib/testcase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,17 @@ export const generateTestcaseBatch = async (cluster: Cluster, count: number) =>
await Promise.all(
testcases.map(async (tc) => {
await Redis.set(RedisKeys.CACHED_TESTCASE_INPUT(cluster.id, tc.id), tc.input, {
EX: 15 * 60,
EX: 3 * 60 * 60,
});
await Redis.set(
RedisKeys.CACHED_TESTCASE_OUTPUT(cluster.id, tc.id),
tc.correct_output ?? "",
{ EX: 15 * 60 }
{ EX: 3 * 60 * 60 }
);
})
);

await Redis.set(RedisKeys.CLUSTER_STATUS(cluster.id), "cached", { EX: 15 * 60 });
await Redis.set(RedisKeys.CLUSTER_STATUS(cluster.id), "cached", { EX: 3 * 60 * 60 });

return testcases;
};

0 comments on commit cd0932d

Please sign in to comment.