Run change hooks and ref-updated events after indexing is done.
The change hooks and ref-updated events were run parallel to the change (re)indexing. This meant that an event-stream sent events to the clients before the change indexing was finished. If a client queried for that change immediately after receiving the event it happened that the response was not-found as the indexing wasn't yet done. Although we haven't had issues with a ref-updated event processors, firing this event will also wait for the indexing task to finish as we never know if a ref-updated event processor may trigger a change query. Change-Id: Iff17c5aeb9675f3991f938d31ef5048ef5b3b956
This commit is contained in:
@@ -120,13 +120,13 @@ public class Restore implements RestModifyView<ChangeResource, RestoreInput>,
|
||||
} catch (Exception e) {
|
||||
log.error("Cannot email update for change " + change.getChangeId(), e);
|
||||
}
|
||||
f.checkedGet();
|
||||
hooks.doChangeRestoredHook(change,
|
||||
caller.getAccount(),
|
||||
db.patchSets().get(change.currentPatchSetId()),
|
||||
Strings.emptyToNull(input.message),
|
||||
dbProvider.get());
|
||||
ChangeInfo result = json.format(change);
|
||||
f.checkedGet();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user