1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00

fix(vcs): prevent an error with one function deployment stopping others

This commit is contained in:
Steven Nguyen 2024-03-10 21:43:22 +01:00
parent 47fddbe8e5
commit 9d6595f85d
No known key found for this signature in database

View file

@ -41,7 +41,9 @@ use Utopia\VCS\Exception\RepositoryNotFound;
use function Swoole\Coroutine\batch;
$createGitDeployments = function (GitHub $github, string $providerInstallationId, array $repositories, string $providerBranch, string $providerBranchUrl, string $providerRepositoryName, string $providerRepositoryUrl, string $providerRepositoryOwner, string $providerCommitHash, string $providerCommitAuthor, string $providerCommitAuthorUrl, string $providerCommitMessage, string $providerCommitUrl, string $providerPullRequestId, bool $external, Database $dbForConsole, Build $queueForBuilds, callable $getProjectDB, Request $request) {
$errors = [];
foreach ($repositories as $resource) {
try {
$resourceType = $resource->getAttribute('resourceType');
if ($resourceType === "function") {
@ -245,9 +247,16 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
//TODO: Add event?
}
} catch (Throwable $e) {
$errors[] = $e->getMessage();
}
}
$queueForBuilds->setType(''); // prevent shutdown hook from triggering again
if (!empty($errors)) {
throw new Exception(Exception::GENERAL_UNKNOWN, \implode("\n", $errors));
}
};
App::get('/v1/vcs/github/authorize')