aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java3
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeConfiguration.java2
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java1
3 files changed, 4 insertions, 2 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java
index dd5cb0d599d..7ca59766678 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/BranchDto.java
@@ -177,8 +177,9 @@ public class BranchDto {
return excludeFromPurge;
}
- public void setExcludeFromPurge(boolean excludeFromPurge) {
+ public BranchDto setExcludeFromPurge(boolean excludeFromPurge) {
this.excludeFromPurge = excludeFromPurge;
+ return this;
}
private static byte[] encodePullRequestData(DbProjectBranches.PullRequestData pullRequestData) {
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeConfiguration.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeConfiguration.java
index c707615368f..0cb95299a38 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeConfiguration.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeConfiguration.java
@@ -55,7 +55,7 @@ public class PurgeConfiguration {
public static PurgeConfiguration newDefaultPurgeConfiguration(Configuration config, String rootUuid, String projectUuid, Set<String> disabledComponentUuids) {
return new PurgeConfiguration(rootUuid, projectUuid, Arrays.asList(Scopes.DIRECTORY, Scopes.FILE), config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES).get(),
- config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_INACTIVE_BRANCHES), System2.INSTANCE, disabledComponentUuids);
+ config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_INACTIVE_BRANCHES_AND_PRS), System2.INSTANCE, disabledComponentUuids);
}
/**
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
index ac8ee748a01..7c1f79e5701 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/component/ComponentDbTester.java
@@ -253,6 +253,7 @@ public class ComponentDbTester {
public final ComponentDto insertMainBranch(ComponentDto project) {
BranchDto branchDto = ComponentTesting.newBranchDto(project, BRANCH);
+ branchDto.setExcludeFromPurge(true);
insertComponent(project);
dbClient.branchDao().insert(dbSession, branchDto);
db.commit();