revert last commit

This commit is contained in:
shimon committed 2024-10-07 13:57:02 +03:00
1 parent fa513d6242
commit 4590ae11ee
3 files changed
+1 -42

No files matched your search

-15
View File
@@ -88,11 +88,7 @@ App::post('/v1/projects')
->inject('hooks')
->action(function (string $projectId, string $name, string $teamId, string $region, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Request $request, Response $response, Database $dbForConsole, Cache $cache, Group $pools, Hooks $hooks) {
$ctime = time();
var_dump("[".$region."] - Before getDocument('teams')");
$team = $dbForConsole->getDocument('teams', $teamId);
$diff = time() - $ctime;
var_dump("[".$region."] - After getDocument('teams') : " . $diff . " sec");
if ($team->isEmpty()) {
throw new Exception(Exception::TEAM_NOT_FOUND);
@@ -149,8 +145,6 @@ App::post('/v1/projects')
}
try {
$ctime = time();
var_dump("[".$region."] - Before createDocument('projects')");
$project = $dbForConsole->createDocument('projects', new Document([
'$id' => $projectId,
'$permissions' => [
@@ -184,10 +178,6 @@ App::post('/v1/projects')
'search' => implode(' ', [$projectId, $name]),
'database' => $dsn,
]));
$diff = time() - $ctime;
var_dump("[".$region."] - After createDocument('projects') : " . $diff . " sec");
} catch (Duplicate) {
throw new Exception(Exception::PROJECT_ALREADY_EXISTS);
}
@@ -239,12 +229,7 @@ App::post('/v1/projects')
}, $collection['indexes']);
try {
$ctime = time();
var_dump("[".$region."] - Before createCollection('".$key."')");
$dbForProject->createCollection($key, $attributes, $indexes);
$diff = time() - $ctime;
var_dump("[".$region."] - After createCollection('".$key."') : " . $diff . " sec");
} catch (Duplicate) {
// Collection already exists
}