1
0
Fork 0
mirror of synced 2024-06-13 16:24:47 +12:00

add try catch

This commit is contained in:
Damodar Lohani 2022-10-16 05:58:25 +00:00
parent c635846dba
commit 00973d4a14

View file

@ -91,9 +91,13 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
/** @var array $collections */
$collections = Config::getParam('collections', []);
$redis->flushAll();
Console::success('[Setup] - Creating database: appwrite...');
$dbForConsole->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
try {
$redis->flushAll();
Console::success('[Setup] - Creating database: appwrite...');
$dbForConsole->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
} catch (\Exception $e) {
Console::error('Failed to create database: ' . $e->getMessage());
}
if ($dbForConsole->getCollection(Audit::COLLECTION)->isEmpty()) {
$audit = new Audit($dbForConsole);