sergehuber commented on code in PR #720: URL: https://github.com/apache/unomi/pull/720#discussion_r2216102567
########## extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/impl/GroovyActionsServiceImpl.java: ########## @@ -209,48 +328,182 @@ private void saveActionType(Action action) { definitionsService.setActionType(actionType); } + /** + * {@inheritDoc} + */ @Override public void remove(String id) { - if (groovyCodeSourceMap.containsKey(id)) { - try { - definitionsService.removeActionType( - groovyShell.parse(groovyCodeSourceMap.get(id)).getClass().getMethod("execute").getAnnotation(Action.class).id()); - } catch (NoSuchMethodException e) { - LOGGER.error("Failed to delete the action type for the id {}", id, e); + validateNotEmpty(id, "Script ID"); + + LOGGER.info("Removing script: {}", id); + + ScriptMetadata removedMetadata = scriptMetadataCache.remove(id); Review Comment: I was trying to minimize the changes that is why I didn't change it. I'll see if I can do a minimal change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@unomi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org