mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Move pool access inside not V2 block
This commit is contained in:
parent
8da2b249b7
commit
0e03842173
1 changed files with 3 additions and 2 deletions
|
|
@ -195,8 +195,6 @@ App::post('/v1/projects')
|
|||
$dsn = new DSN('mysql://' . $dsn);
|
||||
}
|
||||
|
||||
$adapter = $pools->get($dsn->getHost())->pop()->getResource();
|
||||
$dbForProject = new Database($adapter, $cache);
|
||||
$sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));
|
||||
$sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES_V1', ''));
|
||||
|
||||
|
|
@ -206,6 +204,9 @@ App::post('/v1/projects')
|
|||
$sharedTables = $sharedTablesV1 || $sharedTablesV2;
|
||||
|
||||
if (!$sharedTablesV2) {
|
||||
$adapter = $pools->get($dsn->getHost())->pop()->getResource();
|
||||
$dbForProject = new Database($adapter, $cache);
|
||||
|
||||
if ($sharedTables) {
|
||||
$dbForProject
|
||||
->setSharedTables(true)
|
||||
|
|
|
|||
Loading…
Reference in a new issue