[ML] Only audit job creation after it was successful (elastic/x-pack-elasticsearch#1198)

Original commit: elastic/x-pack-elasticsearch@37af6cbf69
This commit is contained in:
David Kyle 2017-04-25 16:04:52 +01:00
parent 612dcda8ae
commit 2d9fd0ed16
1 changed files with 1 additions and 1 deletions

View File

@ -169,12 +169,12 @@ public class JobManager extends AbstractComponent {
jobProvider.createJobResultIndex(job, state, new ActionListener<Boolean>() { jobProvider.createJobResultIndex(job, state, new ActionListener<Boolean>() {
@Override @Override
public void onResponse(Boolean indicesCreated) { public void onResponse(Boolean indicesCreated) {
auditor.info(job.getId(), Messages.getMessage(Messages.JOB_AUDIT_CREATED));
clusterService.submitStateUpdateTask("put-job-" + job.getId(), clusterService.submitStateUpdateTask("put-job-" + job.getId(),
new AckedClusterStateUpdateTask<PutJobAction.Response>(request, actionListener) { new AckedClusterStateUpdateTask<PutJobAction.Response>(request, actionListener) {
@Override @Override
protected PutJobAction.Response newResponse(boolean acknowledged) { protected PutJobAction.Response newResponse(boolean acknowledged) {
auditor.info(job.getId(), Messages.getMessage(Messages.JOB_AUDIT_CREATED));
return new PutJobAction.Response(acknowledged, job); return new PutJobAction.Response(acknowledged, job);
} }