Skip to content

Commit c81fdbb

Browse files
committed
fix: allow assessment retry when today's session failed
Previously, any existing session for today blocked new attempts, even if the session had failed. Now failed sessions are retried.
1 parent 731c927 commit c81fdbb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/cron/worker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ async function processAssessments() {
294294
const existingSession = await prisma.assessmentSession.findFirst({
295295
where: { configId: config.id, date: todayStr },
296296
});
297-
if (existingSession) continue;
297+
// Skip if a session exists and isn't failed — allow retry for failed ones
298+
if (existingSession && existingSession.status !== "FAILED") continue;
298299

299300
const allQuestions = await prisma.assessmentQuestion.findMany({
300301
where: {

0 commit comments

Comments
 (0)