mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
static getCollectionId
This commit is contained in:
parent
07bfe3823c
commit
5764ea9ade
1 changed files with 2 additions and 13 deletions
|
|
@ -59,14 +59,8 @@ abstract class ScheduleBase extends Action
|
||||||
$getSchedule = function (Document $schedule) use ($dbForConsole, $getProjectDB): array {
|
$getSchedule = function (Document $schedule) use ($dbForConsole, $getProjectDB): array {
|
||||||
$project = $dbForConsole->getDocument('projects', $schedule->getAttribute('projectId'));
|
$project = $dbForConsole->getDocument('projects', $schedule->getAttribute('projectId'));
|
||||||
|
|
||||||
$collectionId = match ($schedule->getAttribute('resourceType')) {
|
|
||||||
'function' => 'functions',
|
|
||||||
'message' => 'messages',
|
|
||||||
'backup' => 'backupsPolicy'
|
|
||||||
};
|
|
||||||
|
|
||||||
$resource = $getProjectDB($project)->getDocument(
|
$resource = $getProjectDB($project)->getDocument(
|
||||||
$collectionId,
|
static::getCollectionId(),
|
||||||
$schedule->getAttribute('resourceId')
|
$schedule->getAttribute('resourceId')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -112,12 +106,7 @@ abstract class ScheduleBase extends Action
|
||||||
var_dump('=== ScheduleBase end');
|
var_dump('=== ScheduleBase end');
|
||||||
$this->schedules[$document['resourceId']] = $getSchedule($document);
|
$this->schedules[$document['resourceId']] = $getSchedule($document);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
$collectionId = match ($document->getAttribute('resourceType')) {
|
$collectionId = static::getCollectionId();
|
||||||
'function' => 'functions',
|
|
||||||
'message' => 'messages',
|
|
||||||
'backup' => 'backupsPolicy'
|
|
||||||
};
|
|
||||||
|
|
||||||
Console::error("Failed to load schedule for project {$document['projectId']} {$collectionId} {$document['resourceId']}");
|
Console::error("Failed to load schedule for project {$document['projectId']} {$collectionId} {$document['resourceId']}");
|
||||||
Console::error($th->getMessage());
|
Console::error($th->getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue