Skip to content

Commit

Permalink
Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelblaszczyk5 committed Jan 5, 2024
1 parent f93f998 commit 8a6cad7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prisma/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ if (!DATABASE_PUBLIC_URL) {
throw new Error('DATABASE_PUBLIC_URL must be defined for waking up db');
}

const tryWakingUpDatabase = () => {
const tryWakingUpDatabase = async () => {
console.log('Trying to wake up database via public URL');

try {
new PrismaClient({ datasources: { db: { url: DATABASE_PUBLIC_URL } } }).$connect();
await new PrismaClient({ datasources: { db: { url: DATABASE_PUBLIC_URL } } }).$connect();
} catch {
/* empty */
}
Expand Down Expand Up @@ -54,5 +54,5 @@ const deployPrismaMigrationsWithRetrying = () => {
return execute();
};

tryWakingUpDatabase();
await tryWakingUpDatabase();
await deployPrismaMigrationsWithRetrying();

0 comments on commit 8a6cad7

Please sign in to comment.