From 5620b3acd84961e046ffdc98704af91a297104ae Mon Sep 17 00:00:00 2001 From: Weiying Hua Date: Fri, 10 Nov 2023 16:11:43 +0800 Subject: [PATCH 1/2] remove previous index of event handlers by event if event handler's event gets updated --- .../com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java index c3270706b0..45e577573c 100644 --- a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java +++ b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java @@ -72,6 +72,9 @@ public void updateEventHandler(EventHandler eventHandler) { throw new NotFoundException( "EventHandler with name %s not found!", eventHandler.getName()); } + if(!existing.getEvent().equals(eventHandler.getEvent())){ + removeIndex(existing); + } index(eventHandler); jedisProxy.hset(nsKey(EVENT_HANDLERS), eventHandler.getName(), toJson(eventHandler)); recordRedisDaoRequests("updateEventHandler"); From 9b0d946eda1dfb50ce13746c45e23c7a2c38b088 Mon Sep 17 00:00:00 2001 From: Weiying Hua Date: Fri, 10 Nov 2023 16:21:32 +0800 Subject: [PATCH 2/2] run ./gradlew spotlessApply --- .../com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java index 45e577573c..e0aa0bfd8a 100644 --- a/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java +++ b/redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java @@ -72,7 +72,7 @@ public void updateEventHandler(EventHandler eventHandler) { throw new NotFoundException( "EventHandler with name %s not found!", eventHandler.getName()); } - if(!existing.getEvent().equals(eventHandler.getEvent())){ + if (!existing.getEvent().equals(eventHandler.getEvent())) { removeIndex(existing); } index(eventHandler);