mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 08:28:42 +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());
|
||||
|
||||
$dbForLogs = null;
|
||||
$dbForProject = null;
|
||||
try {
|
||||
/** @var \Utopia\Database\Database $dbForLogs */
|
||||
$dbForLogs = call_user_func($getLogsDB, $project);
|
||||
/** @var \Utopia\Database\Database $dbForProject */
|
||||
$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');
|
||||
|
||||
|
|
@ -162,12 +171,12 @@ class StatsResources extends Action
|
|||
} catch (Throwable $th) {
|
||||
call_user_func_array($this->logError, [$th, "StatsResources", "count_for_functions_{$project->getId()}"]);
|
||||
}
|
||||
|
||||
$this->writeDocuments($dbForLogs, $project);
|
||||
} catch (Throwable $th) {
|
||||
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());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue