update project rsource

This commit is contained in:
Damodar Lohani 2024-12-17 04:27:28 +00:00
parent f785602a4d
commit 06c09503df

View file

@ -62,7 +62,13 @@ Server::setResource('project', function (Message $message, Database $dbForPlatfo
return $project;
}
return $dbForPlatform->getDocument('projects', $project->getId());
// NOT all workers need valid DB config so we return empty if this fails
try {
return $dbForPlatform->getDocument('projects', $project->getId());
} catch (\Throwable $e) {
return new Document([]);
}
}, ['message', 'dbForPlatform']);
Server::setResource('dbForProject', function (Cache $cache, Registry $register, Message $message, Document $project, Database $dbForPlatform) {