mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🚨 Remove process.exit usage
This commit is contained in:
parent
b1d8595a7c
commit
076e930369
8 changed files with 22 additions and 45 deletions
|
|
@ -52,7 +52,6 @@ export const setupDatabase = async (info = true) => {
|
|||
return;
|
||||
}
|
||||
|
||||
logger.fatal`${e}`;
|
||||
logger.fatal`Failed to connect to database ${chalk.bold(
|
||||
// Index of the database in the array
|
||||
replicas.indexOf(dbPool) === -1
|
||||
|
|
@ -60,8 +59,7 @@ export const setupDatabase = async (info = true) => {
|
|||
: `replica-${replicas.indexOf(dbPool)}`,
|
||||
)}. Please check your configuration.`;
|
||||
|
||||
// Hang until Ctrl+C is pressed
|
||||
await Bun.sleep(Number.POSITIVE_INFINITY);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ export const setupDatabase = async (info = true) => {
|
|||
migrationsFolder: "./drizzle/migrations",
|
||||
});
|
||||
} catch (e) {
|
||||
logger.fatal`${e}`;
|
||||
logger.fatal`Failed to migrate database. Please check your configuration.`;
|
||||
|
||||
// Hang until Ctrl+C is pressed
|
||||
await Bun.sleep(Number.POSITIVE_INFINITY);
|
||||
throw e;
|
||||
}
|
||||
|
||||
info && logger.info`Database migrated`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue