diff --git a/src/Service/GithubApiService.php b/src/Service/GithubApiService.php index af8b8b0c..3bf886a0 100644 --- a/src/Service/GithubApiService.php +++ b/src/Service/GithubApiService.php @@ -351,6 +351,8 @@ public function getConnectedComponents(ObjectEntity $organization, array $openca // Get the github repository from the given url if the object is null. if ($repositorySync->getObject() === null) { + $this->entityManager->remove($repositorySync); + $this->entityManager->flush(); $repository = $this->getGithubRepository($repositoryUrl); } @@ -409,6 +411,8 @@ public function getConnectedComponents(ObjectEntity $organization, array $openca // Get the github repository from the given url if the object is null. if ($repositorySync->getObject() === null) { + $this->entityManager->remove($repositorySync); + $this->entityManager->flush(); $repository = $this->getGithubRepository($repositoryUrl); }