use of com.google.gerrit.server.mail.send.MergedSender in project gerrit by GerritCodeReview.
the class MergedByPushOp method postUpdate.
@Override
public void postUpdate(final Context ctx) {
if (!correctBranch) {
return;
}
// Runnable already handles errors
@SuppressWarnings("unused") Future<?> possiblyIgnoredError = sendEmailExecutor.submit(requestScopePropagator.wrap(new Runnable() {
@Override
public void run() {
try {
MergedSender cm = mergedSenderFactory.create(ctx.getProject(), psId.getParentKey());
cm.setFrom(ctx.getAccountId());
cm.setPatchSet(patchSet, info);
cm.send();
} catch (Exception e) {
log.error("Cannot send email for submitted patch set " + psId, e);
}
}
@Override
public String toString() {
return "send-email merged";
}
}));
changeMerged.fire(change, patchSet, ctx.getAccount(), patchSet.getRevision().get(), ctx.getWhen());
}
use of com.google.gerrit.server.mail.send.MergedSender in project gerrit by GerritCodeReview.
the class EmailMerge method run.
@Override
public void run() {
RequestContext old = requestContext.setContext(this);
try {
MergedSender cm = mergedSenderFactory.create(project, changeId);
if (submitter != null) {
cm.setFrom(submitter);
}
cm.setNotify(notifyHandling);
cm.setAccountsToNotify(accountsToNotify);
cm.send();
} catch (Exception e) {
log.error("Cannot email merged notification for " + changeId, e);
} finally {
requestContext.setContext(old);
if (db != null) {
db.close();
db = null;
}
}
}
Aggregations