Convert most ChangeApi handlers to retrying wrappers

Excludes a few that will require more work to plumb the
BatchUpdate.Factory into the class that actually does the work.

Change-Id: Id8c679c91ed8ea142f1856fcc2d976c4fb609dc5
This commit is contained in:
Dave Borowitz
2017-05-02 11:56:55 -04:00
parent 04f8f397d7
commit ae52afc058
21 changed files with 191 additions and 145 deletions

View File

@@ -607,6 +607,8 @@ class ChangeApiImpl implements ChangeApi {
@Override
public ChangeInfo check(FixInput fix) throws RestApiException {
try {
// TODO(dborowitz): Convert to RetryingRestModifyView. Needs to plumb BatchUpdate.Factory into
// ConsistencyChecker.
return check.apply(change, fix).value();
} catch (Exception e) {
throw asRestApiException("Cannot check change", e);
@@ -624,6 +626,8 @@ class ChangeApiImpl implements ChangeApi {
@Override
public void ignore(boolean ignore) throws RestApiException {
// TODO(dborowitz): Convert to RetryingRestModifyView. Needs to plumb BatchUpdate.Factory into
// StarredChangesUtil.
if (ignore) {
this.ignore.apply(change, new Ignore.Input());
} else {
@@ -633,6 +637,8 @@ class ChangeApiImpl implements ChangeApi {
@Override
public void mute(boolean mute) throws RestApiException {
// TODO(dborowitz): Convert to RetryingRestModifyView. Needs to plumb BatchUpdate.Factory into
// StarredChangesUtil.
if (mute) {
this.mute.apply(change, new Mute.Input());
} else {