Skip to content

Commit

Permalink
Address the comment from @ikhoon
Browse files Browse the repository at this point in the history
  • Loading branch information
minwoox committed Aug 30, 2024
1 parent cbaba99 commit 9a5b3e8
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void start() throws Exception {
}

final Stopwatch stopwatch = Stopwatch.createStarted();
int numMigratedProjects = 0;
int numProjects = 0;
try {
for (Project project : projectManager.list().values()) {
if (InternalProjectInitializer.INTERNAL_PROJECT_DOGMA.equals(project.name())) {
Expand All @@ -92,12 +92,14 @@ void start() throws Exception {
((ObjectNode) content).without("hostnamePatterns")));
}

if (!changes.isEmpty()) {
numMigratedProjects++;
logger.info("hostnamePatterns in credentials are removed in the project: {}",
project.name());
if (changes.isEmpty()) {
continue;
}

numProjects++;
logger.info("hostnamePatterns in credentials are removed in the project: {}",
project.name());

commandExecutor.execute(Command.forcePush(Command.push(
Author.SYSTEM, project.name(), Project.REPO_META, Revision.HEAD,
"Remove hostnamePatterns in credentials.", "", Markup.PLAINTEXT,
Expand All @@ -109,7 +111,7 @@ void start() throws Exception {
}
}
logger.info("hostnamePatterns are removed in {} projects. (took: {} ms.)",
numMigratedProjects, stopwatch.elapsed().toMillis());
numProjects, stopwatch.elapsed().toMillis());
} finally {
// Exit read-only mode.
commandExecutor.execute(Command.updateServerStatus(ServerStatus.WRITABLE))
Expand Down

0 comments on commit 9a5b3e8

Please sign in to comment.