Skip to content

Commit

Permalink
Fix retry numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelblaszczyk5 committed Jan 4, 2024
1 parent d222fc0 commit d623355
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions prisma/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const deployPrismaMigrationsWithRetrying = () => {
if (!isDatabaseUnavailable) throw error;

const delayMs = BASE_DELAY * 2 ** currentRetry;
currentRetry += 1;

// eslint-disable-next-line no-console -- this is for debugging in deployment logs
console.log(`Retrying migrations #${currentRetry} after ${delayMs}ms`);
Expand All @@ -29,8 +30,6 @@ const deployPrismaMigrationsWithRetrying = () => {
setTimeout(resolve, delayMs);
});

currentRetry += 1;

execute();
}
};
Expand Down

0 comments on commit d623355

Please sign in to comment.