From a72dc9e8fc4eeb174ef3d6a20738523b70c2e212 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Tue, 26 Jun 2018 16:14:40 +0200 Subject: [PATCH] Watcher: Remove never executed code (#31135) The removed code snippet was never executed, as the version was never set and thus always -1, after parsing the watch. With the changes done in c9d77d20fdb8a46b614515555d5d0697b2c6e5fc this logic would not have worked correctly anyway. --- .../xpack/watcher/WatcherIndexingListener.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java index 8e0fbcb7cb4f..f3b77b922aa8 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java @@ -110,16 +110,6 @@ public Engine.Index preIndex(ShardId shardId, Engine.Index operation) { return operation; } - // the watch status is -1, in case a watch has been freshly stored and this save - // watch operation does not stem from an execution - // we dont need to update the trigger service, when the watch has been updated as - // part of an execution, so we can exit early - boolean isWatchExecutionOperation = watch.status().version() != -1; - if (isWatchExecutionOperation) { - logger.debug("not updating trigger for watch [{}], watch has been updated as part of an execution", watch.id()); - return operation; - } - boolean shouldBeTriggered = shardAllocationConfiguration.shouldBeTriggered(watch.id()); if (shouldBeTriggered) { if (watch.status().state().isActive()) {