diff --git a/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableEventHandlerDAO.java b/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableEventHandlerDAO.java index 5b1132552..d2632a538 100644 --- a/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableEventHandlerDAO.java +++ b/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableEventHandlerDAO.java @@ -68,13 +68,19 @@ public void scheduleEventHandlerRefresh() { } @Override - @CachePut(value = EVENT_HANDLER_CACHE, key = "#eventHandler.name") + @CachePut( + value = EVENT_HANDLER_CACHE, + key = "#eventHandler.name", + condition = "#eventHandler != null") public void addEventHandler(EventHandler eventHandler) { scyllaEventHandlerDAO.addEventHandler(eventHandler); } @Override - @CachePut(value = EVENT_HANDLER_CACHE, key = "#eventHandler.name") + @CachePut( + value = EVENT_HANDLER_CACHE, + key = "#eventHandler.name", + condition = "#eventHandler != null") public void updateEventHandler(EventHandler eventHandler) { scyllaEventHandlerDAO.updateEventHandler(eventHandler); } diff --git a/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableMetadataDAO.java b/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableMetadataDAO.java index 14a45956e..023d25fa0 100644 --- a/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableMetadataDAO.java +++ b/scylla-persistence/src/main/java/com/netflix/conductor/scylla/config/cache/CacheableMetadataDAO.java @@ -72,14 +72,14 @@ public void scheduleCacheRefresh() { } @Override - @CachePut(value = TASK_DEF_CACHE, key = "#taskDef.name") + @CachePut(value = TASK_DEF_CACHE, key = "#taskDef.name", condition = "#taskDef != null") public TaskDef createTaskDef(TaskDef taskDef) { scyllaMetadataDAO.createTaskDef(taskDef); return taskDef; } @Override - @CachePut(value = TASK_DEF_CACHE, key = "#taskDef.name") + @CachePut(value = TASK_DEF_CACHE, key = "#taskDef.name", condition = "#taskDef != null") public TaskDef updateTaskDef(TaskDef taskDef) { return scyllaMetadataDAO.updateTaskDef(taskDef); }