mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Revert "Disallow injecting platform DB as project DB"
This reverts commit 09c132414f.
# Conflicts:
# src/Appwrite/Platform/Workers/Deletes.php
This commit is contained in:
+5
-5
@@ -97,12 +97,12 @@ CLI::setResource('dbForPlatform', function ($pools, $cache) {
|
||||
return $dbForPlatform;
|
||||
}, ['pools', 'cache']);
|
||||
|
||||
CLI::setResource('getProjectDB', function (Group $pools, Cache $cache) {
|
||||
$databases = [];
|
||||
CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) {
|
||||
$databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools
|
||||
|
||||
return function (Document $project) use ($pools, $cache, &$databases) {
|
||||
return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) {
|
||||
if ($project->isEmpty() || $project->getId() === 'console') {
|
||||
throw new \Exception('Trying to inject project database using console project. Use "dbForPlatform" instead');
|
||||
return $dbForPlatform;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -158,7 +158,7 @@ CLI::setResource('getProjectDB', function (Group $pools, Cache $cache) {
|
||||
|
||||
return $database;
|
||||
};
|
||||
}, ['pools', 'cache']);
|
||||
}, ['pools', 'dbForPlatform', 'cache']);
|
||||
|
||||
CLI::setResource('queue', function (Group $pools) {
|
||||
return $pools->get('queue')->pop()->getResource();
|
||||
|
||||
Reference in New Issue
Block a user