use of org.sonar.server.platform.db.migration.step.MigrationStepExecutionException in project sonarqube by SonarSource.
the class DatabaseMigrationImpl method doDatabaseMigration.
private void doDatabaseMigration() {
migrationState.setStatus(Status.RUNNING);
migrationState.setStartedAt(new Date());
migrationState.setError(null);
Profiler profiler = Profiler.create(LOGGER);
try {
profiler.startInfo("Starting DB Migration and container restart");
doUpgradeDb();
doRestartContainer();
migrationState.setStatus(Status.SUCCEEDED);
profiler.stopInfo("DB Migration and container restart: success");
} catch (MigrationStepExecutionException e) {
profiler.stopError("DB migration failed");
LOGGER.error("DB migration ended with an exception", e);
saveStatus(e);
} catch (Throwable t) {
profiler.stopError("Container restart failed");
LOGGER.error("Container restart failed", t);
saveStatus(t);
} finally {
running.getAndSet(false);
}
}
Aggregations