diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-06-10 15:48:47 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-06-13 20:21:12 +0200 |
commit | 2f48b3196168af75ebe269ad8d9e913bad2437b8 (patch) | |
tree | 56549d54813150270cd02f3a09e944ee25bd7735 /server/sonar-db-dao | |
parent | c1e973762772c0ecfc56e921d44ff3f495fe6fcd (diff) | |
download | sonarqube-2f48b3196168af75ebe269ad8d9e913bad2437b8.tar.gz sonarqube-2f48b3196168af75ebe269ad8d9e913bad2437b8.zip |
SONAR-12146 fix resilience of deletion of project/branch/view
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r-- | server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java index d765b932def..1f0c55ff2b0 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java @@ -245,28 +245,28 @@ public class PurgeDao implements Dao { deleteRootComponent(uuid, purgeMapper, purgeCommands); } - private void deleteRootComponent(String rootUuid, PurgeMapper mapper, PurgeCommands commands) { + private static void deleteRootComponent(String rootUuid, PurgeMapper mapper, PurgeCommands commands) { List<IdUuidPair> rootAndModulesOrSubviews = mapper.selectRootAndModulesOrSubviewsByProjectUuid(rootUuid); long rootId = rootAndModulesOrSubviews.stream() .filter(pair -> pair.getUuid().equals(rootUuid)) .map(IdUuidPair::getId) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Couldn't find root component with uuid " + rootUuid)); - commands.deletePermissions(rootId); commands.deleteLinks(rootUuid); commands.deleteAnalyses(rootUuid); commands.deleteByRootAndModulesOrSubviews(rootAndModulesOrSubviews); - commands.deleteComponents(rootUuid); commands.deleteIssues(rootUuid); commands.deleteFileSources(rootUuid); commands.deleteCeActivity(rootUuid); commands.deleteCeQueue(rootUuid); commands.deleteWebhooks(rootUuid); commands.deleteWebhookDeliveries(rootUuid); + commands.deleteLiveMeasures(rootUuid); commands.deleteProjectMappings(rootUuid); commands.deleteProjectAlmBindings(rootUuid); + commands.deletePermissions(rootId); commands.deleteBranch(rootUuid); - commands.deleteLiveMeasures(rootUuid); + commands.deleteComponents(rootUuid); } /** |