mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
fix worker
This commit is contained in:
parent
ec9045b488
commit
e8faf2a859
1 changed files with 11 additions and 2 deletions
|
|
@ -85,11 +85,20 @@ class StatsResources extends Action
|
||||||
{
|
{
|
||||||
Console::info('Begining count for: ' . $project->getId());
|
Console::info('Begining count for: ' . $project->getId());
|
||||||
|
|
||||||
|
$dbForLogs = null;
|
||||||
|
$dbForProject = null;
|
||||||
try {
|
try {
|
||||||
/** @var \Utopia\Database\Database $dbForLogs */
|
/** @var \Utopia\Database\Database $dbForLogs */
|
||||||
$dbForLogs = call_user_func($getLogsDB, $project);
|
$dbForLogs = call_user_func($getLogsDB, $project);
|
||||||
/** @var \Utopia\Database\Database $dbForProject */
|
/** @var \Utopia\Database\Database $dbForProject */
|
||||||
$dbForProject = call_user_func($getProjectDB, $project);
|
$dbForProject = call_user_func($getProjectDB, $project);
|
||||||
|
} catch (Throwable $th) {
|
||||||
|
Console::error('Unable to get database');
|
||||||
|
Console::error($th->getMessage());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
$region = $project->getAttribute('region');
|
$region = $project->getAttribute('region');
|
||||||
|
|
||||||
|
|
@ -162,12 +171,12 @@ class StatsResources extends Action
|
||||||
} catch (Throwable $th) {
|
} catch (Throwable $th) {
|
||||||
call_user_func_array($this->logError, [$th, "StatsResources", "count_for_functions_{$project->getId()}"]);
|
call_user_func_array($this->logError, [$th, "StatsResources", "count_for_functions_{$project->getId()}"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->writeDocuments($dbForLogs, $project);
|
||||||
} catch (Throwable $th) {
|
} catch (Throwable $th) {
|
||||||
call_user_func_array($this->logError, [$th, "StatsResources", "count_for_project_{$project->getId()}"]);
|
call_user_func_array($this->logError, [$th, "StatsResources", "count_for_project_{$project->getId()}"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->writeDocuments($dbForLogs, $project);
|
|
||||||
|
|
||||||
Console::info('End of count for: ' . $project->getId());
|
Console::info('End of count for: ' . $project->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue