Skip to content

Commit 7900894

Browse files
committed
fix(prisma): add success log after retry recovery
1 parent 4082aff commit 7900894

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

webapp/src/lib/prisma.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ async function withRetry<T>(fn: () => Promise<T>, maxRetries = 3, baseDelay = 50
3535
let lastError: unknown;
3636
for (let attempt = 0; attempt <= maxRetries; attempt++) {
3737
try {
38-
return await fn();
38+
const result = await fn();
39+
if (attempt > 0) {
40+
console.warn(`Prisma query succeeded after ${attempt} retry(s)`);
41+
}
42+
return result;
3943
} catch (error) {
4044
lastError = error;
4145
if (attempt === maxRetries || !isRetryableError(error)) throw error;

0 commit comments

Comments
 (0)