From: Julien Lancelot Date: Tue, 23 Dec 2014 15:06:44 +0000 (+0100) Subject: SONAR-5995 Remove log on memory leak generated by ProgressLogger when stopping the... X-Git-Tag: 4.5.2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=468b76d034dfd67f4a4b001e923cf8cfc9803a5e;p=sonarqube.git SONAR-5995 Remove log on memory leak generated by ProgressLogger when stopping the server --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v451/AddMissingCustomRuleParametersMigration.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v451/AddMissingCustomRuleParametersMigration.java index 4012a7321b9..6ee61f983e0 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v451/AddMissingCustomRuleParametersMigration.java +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v451/AddMissingCustomRuleParametersMigration.java @@ -53,10 +53,6 @@ public class AddMissingCustomRuleParametersMigration implements DatabaseMigratio private final DbClient db; private final System2 system; - private final AtomicLong counter = new AtomicLong(0L); - private final MassUpdate.ProgressTask progressTask = new MassUpdate.ProgressTask(counter); - - public AddMissingCustomRuleParametersMigration(DbClient db, System2 system) { this.db = db; this.system = system; @@ -64,6 +60,9 @@ public class AddMissingCustomRuleParametersMigration implements DatabaseMigratio @Override public void execute() { + AtomicLong counter = new AtomicLong(0L); + MassUpdate.ProgressTask progressTask = new MassUpdate.ProgressTask(counter); + Timer timer = new Timer("Db Migration Progress"); timer.schedule(progressTask, MassUpdate.ProgressTask.PERIOD_MS, MassUpdate.ProgressTask.PERIOD_MS);