Merge pull request #11322 from appwrite/feat-enable-logging

Replace region check with project ID check for execution logging
This commit is contained in:
Luke B. Silver
2026-02-13 19:27:36 +00:00
committed by GitHub
2 changed files with 5 additions and 5 deletions
@@ -301,7 +301,7 @@ class Create extends Base
if ($async) {
if (is_null($scheduledAt)) {
if (System::getEnv('_APP_REGION') !== 'nyc') { // TODO: Remove region check
if ($project->getId() != '6862e6a6000cce69f9da') {
$execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution));
}
$queueForFunctions
@@ -344,7 +344,7 @@ class Create extends Base
->setAttribute('scheduleInternalId', $schedule->getSequence())
->setAttribute('scheduledAt', $scheduledAt);
if (System::getEnv('_APP_REGION') !== 'nyc') { // TODO: Remove region check
if ($project->getId() != '6862e6a6000cce69f9da') {
$execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution));
}
}
@@ -505,7 +505,7 @@ class Create extends Base
->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT)))
;
if (System::getEnv('_APP_REGION') !== 'nyc') { // TODO: Remove region check
if ($project->getId() != '6862e6a6000cce69f9da') {
$execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution));
}
}
+2 -2
View File
@@ -7,7 +7,6 @@ use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Platform\Action;
use Utopia\Queue\Message;
use Utopia\System\System;
class Executions extends Action
{
@@ -45,7 +44,8 @@ class Executions extends Action
throw new Exception('Missing execution');
}
if (System::getEnv('_APP_REGION') !== 'nyc') { // TODO: Remove region check
$project = new Document($payload['project'] ?? []);
if ($project->getId() != '6862e6a6000cce69f9da') {
$dbForProject->upsertDocument('executions', $execution);
}
}