aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-01 17:47:16 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-01 17:47:16 +0100
commit161500d45b63110519c7f9830eca58c9f84b7233 (patch)
treeff66f64a1efbdfea0f90458d3d18fe6e89249814 /server
parent543e7cad315546d672e110a769444b3e8ae6049f (diff)
downloadsonarqube-161500d45b63110519c7f9830eca58c9f84b7233.tar.gz
sonarqube-161500d45b63110519c7f9830eca58c9f84b7233.zip
SONAR-7330 Fix indexation of debt model reset
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
index 997fb701a8f..ad69b0639a4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
@@ -108,7 +108,7 @@ public class DebtModelBackup {
public void reset() {
checkPermission();
- Date updateDate = new Date(system2.now());
+ long updateDate = system2.now();
DbSession session = dbClient.openSession(false);
try {
// Restore rules
@@ -125,14 +125,14 @@ public class DebtModelBackup {
resetRules(ruleDtos, rules, updateDate, session);
}
- ruleIndexer.index();
session.commit();
+ ruleIndexer.index();
} finally {
MyBatis.closeQuietly(session);
}
}
- private void resetRules(List<RuleDto> ruleDtos, List<RulesDefinition.Rule> rules, Date updateDate, DbSession session) {
+ private void resetRules(List<RuleDto> ruleDtos, List<RulesDefinition.Rule> rules, long updateDate, DbSession session) {
for (RuleDto rule : ruleDtos) {
// Restore default debt definitions
@@ -158,7 +158,7 @@ public class DebtModelBackup {
rule.setRemediationFunction(null);
rule.setRemediationCoefficient(null);
rule.setRemediationOffset(null);
- rule.setUpdatedAt(updateDate.getTime());
+ rule.setUpdatedAt(updateDate);
dbClient.ruleDao().update(session, rule);
}
}