ilgrosso commented on a change in pull request #213:
URL: https://github.com/apache/syncope/pull/213#discussion_r491933148



##########
File path: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
##########
@@ -436,7 +413,13 @@ public int count(
     @Transactional(rollbackFor = { Throwable.class })
     @Override
     public <T extends Task> T save(final T task) {
-        return entityManager().merge(task);
+        T merged = entityManager().merge(task);
+
+        // propagate the event only for Propagation tasks
+        if (merged instanceof PropagationTask) {
+            publisher.publishEvent(new TaskCreatedUpdatedEvent<>(this, merged, 
AuthContextUtils.getDomain()));

Review comment:
       It does not make much sense to leave open about things that will never 
be invoked, as the only caller can realistically be `JPATaskDAO`, and a clear 
`if` is placed there around publisher invocation.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to