Skip to content

Commit

Permalink
Merge pull request #7468 from QualitativeDataRepository/IQSS/7467
Browse files Browse the repository at this point in the history
send emails from onSuccess
  • Loading branch information
kcondon authored Jan 5, 2021
2 parents fedc4a9 + 8852c6d commit 28406b5
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ public Dataset execute(CommandContext ctxt) throws CommandException {

Dataset readyDataset = ctxt.em().merge(theDataset);

if ( readyDataset != null ) {
// Success! - send notification:
notifyUsersDatasetPublishStatus(ctxt, theDataset, UserNotification.Type.PUBLISHEDDS);
}

// Finally, unlock the dataset:
ctxt.datasets().removeDatasetLocks(theDataset, DatasetLock.Reason.Workflow);
ctxt.datasets().removeDatasetLocks(theDataset, DatasetLock.Reason.finalizePublication);
Expand All @@ -219,6 +214,12 @@ public boolean onSuccess(CommandContext ctxt, Object r) {
dataset = ((PublishDatasetResult) r).getDataset();
}

try {
// Success! - send notification:
notifyUsersDatasetPublishStatus(ctxt, dataset, UserNotification.Type.PUBLISHEDDS);
} catch (Exception e) {
logger.warning("Failure to send dataset published messages for : " + dataset.getId() + " : " + e.getMessage());
}
try {
Future<String> indexString = ctxt.index().indexDataset(dataset, true);
} catch (IOException | SolrServerException e) {
Expand Down

0 comments on commit 28406b5

Please sign in to comment.