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 16, 2024
1 parent 86dd1bb commit 7a944f0
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.linecorp.centraldogma.common.RepositoryExistsException;
import com.linecorp.centraldogma.common.Revision;
import com.linecorp.centraldogma.internal.Jackson;
import com.linecorp.centraldogma.server.command.Command;
import com.linecorp.centraldogma.server.command.CommandExecutor;
import com.linecorp.centraldogma.server.metadata.MetadataService;
import com.linecorp.centraldogma.server.metadata.Tokens;
Expand Down Expand Up @@ -93,7 +94,8 @@ public void initialize0(String projectName) {
final long creationTimeMillis = System.currentTimeMillis();
if (!projectManager.exists(projectName)) {
try {
executor.execute(createProject(creationTimeMillis, Author.SYSTEM, projectName))
executor.execute(Command.forcePush(
createProject(creationTimeMillis, Author.SYSTEM, projectName)))
.get();
} catch (Throwable cause) {
final Throwable peeled = Exceptions.peel(cause);
Expand Down Expand Up @@ -121,8 +123,9 @@ private void initializeTokens() {
null, Jackson.valueToTree(new Tokens()));
final String commitSummary = "Initialize the token list file: /" + INTERNAL_PROJECT_DOGMA + '/' +
Project.REPO_DOGMA + MetadataService.TOKEN_JSON;
executor.execute(push(Author.SYSTEM, INTERNAL_PROJECT_DOGMA, Project.REPO_DOGMA, Revision.HEAD,
commitSummary, "", Markup.PLAINTEXT, ImmutableList.of(change)))
executor.execute(Command.forcePush(push(Author.SYSTEM, INTERNAL_PROJECT_DOGMA, Project.REPO_DOGMA,
Revision.HEAD, commitSummary, "", Markup.PLAINTEXT,
ImmutableList.of(change))))
.get();
} catch (Throwable cause) {
final Throwable peeled = Exceptions.peel(cause);
Expand Down Expand Up @@ -154,7 +157,8 @@ private void initializeInternalRepos(String projectName, List<String> internalRe
continue;
}
try {
executor.execute(createRepository(creationTimeMillis, Author.SYSTEM, projectName, repo))
executor.execute(Command.forcePush(
createRepository(creationTimeMillis, Author.SYSTEM, projectName, repo)))
.get();
} catch (Throwable cause) {
final Throwable peeled = Exceptions.peel(cause);
Expand Down

0 comments on commit 7a944f0

Please sign in to comment.