Index changes after PostReviewers

Change-Id: I36e71cbc309a761a68b6d9e7632faedb93714193
This commit is contained in:
Dave Borowitz
2013-09-13 15:01:23 -04:00
parent 8828458f53
commit 44a6a5a209

View File

@@ -48,6 +48,7 @@ import com.google.gerrit.server.change.ReviewerJson.PostResult;
import com.google.gerrit.server.change.ReviewerJson.ReviewerInfo; import com.google.gerrit.server.change.ReviewerJson.ReviewerInfo;
import com.google.gerrit.server.config.GerritServerConfig; import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.group.GroupsCollection; import com.google.gerrit.server.group.GroupsCollection;
import com.google.gerrit.server.index.ChangeIndexer;
import com.google.gerrit.server.mail.AddReviewerSender; import com.google.gerrit.server.mail.AddReviewerSender;
import com.google.gerrit.server.project.ChangeControl; import com.google.gerrit.server.project.ChangeControl;
import com.google.gerrit.server.project.NoSuchProjectException; import com.google.gerrit.server.project.NoSuchProjectException;
@@ -94,6 +95,7 @@ public class PostReviewers implements RestModifyView<ChangeResource, Input> {
private final ChangeHooks hooks; private final ChangeHooks hooks;
private final AccountCache accountCache; private final AccountCache accountCache;
private final ReviewerJson json; private final ReviewerJson json;
private final ChangeIndexer indexer;
@Inject @Inject
PostReviewers(AccountsCollection accounts, PostReviewers(AccountsCollection accounts,
@@ -108,7 +110,8 @@ public class PostReviewers implements RestModifyView<ChangeResource, Input> {
@GerritServerConfig Config cfg, @GerritServerConfig Config cfg,
ChangeHooks hooks, ChangeHooks hooks,
AccountCache accountCache, AccountCache accountCache,
ReviewerJson json) { ReviewerJson json,
ChangeIndexer indexer) {
this.accounts = accounts; this.accounts = accounts;
this.reviewerFactory = reviewerFactory; this.reviewerFactory = reviewerFactory;
this.addReviewerSenderFactory = addReviewerSenderFactory; this.addReviewerSenderFactory = addReviewerSenderFactory;
@@ -122,6 +125,7 @@ public class PostReviewers implements RestModifyView<ChangeResource, Input> {
this.hooks = hooks; this.hooks = hooks;
this.accountCache = accountCache; this.accountCache = accountCache;
this.json = json; this.json = json;
this.indexer = indexer;
} }
@Override @Override
@@ -255,6 +259,7 @@ public class PostReviewers implements RestModifyView<ChangeResource, Input> {
db.rollback(); db.rollback();
} }
indexer.index(rsrc.getChange());
accountLoaderFactory.create(true).fill(result.reviewers); accountLoaderFactory.create(true).fill(result.reviewers);
postAdd(rsrc.getChange(), result); postAdd(rsrc.getChange(), result);
} }