fix(vcs): prevent an error with one function deployment stopping others
This commit is contained in:
parent
47fddbe8e5
commit
9d6595f85d
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue