modified reactive chain consumption for the detach remote

This commit is contained in:
sondermanish 2025-03-10 19:41:45 +05:30
parent eeb3abb8f2
commit 89c18292ad

View File

@ -1669,7 +1669,15 @@ public class CentralGitServiceCEImpl implements CentralGitServiceCE {
.filter(artifact -> { .filter(artifact -> {
return artifact.getId().equals(baseArtifactId); return artifact.getId().equals(baseArtifactId);
}) })
.next(); .collectList()
.flatMap(filteredBaseArtifact -> {
if (!filteredBaseArtifact.isEmpty()) {
return Mono.just(filteredBaseArtifact.get(0));
}
return Mono.error(new AppsmithException(
AppsmithError.GIT_GENERIC_ERROR, GitCommandConstants.DELETE));
});
return Mono.zip(deleteAllBranchesExceptBase, removeRepoMono).map(Tuple2::getT1); return Mono.zip(deleteAllBranchesExceptBase, removeRepoMono).map(Tuple2::getT1);
}) })