diff --git a/app/http.php b/app/http.php index 125c4af75..6b48cc1c8 100644 --- a/app/http.php +++ b/app/http.php @@ -50,16 +50,21 @@ $http->on('AfterReload', function($serv, $workerId) { Console::success('Reload completed...'); }); -$http->on('start', function (Server $http) use ($payloadSize) { +Files::load(__DIR__ . '/../public'); +include __DIR__ . '/controllers/general.php'; + +$http->on('start', function (Server $http) use ($payloadSize, $register) { $app = new App('UTC'); $dbForConsole = $app->getResource('dbForConsole'); /** @var Utopia\Database\Database $dbForConsole */ if(!$dbForConsole->exists()) { Console::success('[Setup] - Server database init started...'); - + $collections = Config::getParam('collections2', []); /** @var array $collections */ + $register->get('cache')->flushAll(); + $dbForConsole->create(); foreach ($collections as $key => $collection) { @@ -104,10 +109,6 @@ $http->on('start', function (Server $http) use ($payloadSize) { }); }); -Files::load(__DIR__ . '/../public'); - -include __DIR__ . '/controllers/general.php'; - $domain = App::getEnv('_APP_DOMAIN', ''); Console::info('Issuing a TLS certificate for the master domain ('.$domain.') in 30 seconds.