fix: 🚑 Sleep process instead of exiting it on error

Avoids Docker's auto-restart policy from causing infinite reboots and hanging the system
This commit is contained in:
Jesse Wierzbinski 2024-06-13 23:44:46 -10:00
parent 7ba0eb82f1
commit c764cc044d
No known key found for this signature in database
4 changed files with 24 additions and 7 deletions

View file

@ -34,7 +34,9 @@ export const setupDatabase = async (
"Database",
"Failed to connect to database. Please check your configuration.",
);
process.exit();
// Hang until Ctrl+C is pressed
await Bun.sleep(Number.POSITIVE_INFINITY);
}
// Migrate the database
@ -52,7 +54,9 @@ export const setupDatabase = async (
"Database",
"Failed to migrate database. Please check your configuration.",
);
process.exit();
// Hang until Ctrl+C is pressed
await Bun.sleep(Number.POSITIVE_INFINITY);
}
info && (await logger.log(LogLevel.Info, "Database", "Database migrated"));