[ML] Only push live update if job is opened

Original commit: elastic/x-pack-elasticsearch@5318d65012
This commit is contained in:
Martijn van Groningen 2017-03-24 16:31:38 +01:00
parent 60a3fbff85
commit 1d660f373f
1 changed files with 6 additions and 1 deletions

View File

@ -248,7 +248,12 @@ public class JobManager extends AbstractComponent {
@Override
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
updateJobProcessNotifier.submitJobUpdate(jobUpdate);
PersistentTasksCustomMetaData persistentTasks =
newState.metaData().custom(PersistentTasksCustomMetaData.TYPE);
JobState jobState = MlMetadata.getJobState(jobId, persistentTasks);
if (jobState == JobState.OPENED) {
updateJobProcessNotifier.submitJobUpdate(jobUpdate);
}
}
});
}