Jean-Francois Leveque

Refactoring

...@@ -91,6 +91,12 @@ public class PublisherServiceDefault implements PublisherService { ...@@ -91,6 +91,12 @@ public class PublisherServiceDefault implements PublisherService {
91 publisherAction.setPublisherVersion(publisherVersion); 91 publisherAction.setPublisherVersion(publisherVersion);
92 publisherAction.setPublisher(publisher); 92 publisherAction.setPublisher(publisher);
93 this.savePublisher(publisher); 93 this.savePublisher(publisher);
94 + this.index(publisher);
95 + publisherActionRepository.save(publisherAction);
96 + return publisherAction;
97 + }
98 +
99 + protected void index(Publisher publisher) {
94 IndexedPublisher indexedPublisher = new IndexedPublisher(publisher); 100 IndexedPublisher indexedPublisher = new IndexedPublisher(publisher);
95 try { 101 try {
96 publisherSearchRepository.save(indexedPublisher); 102 publisherSearchRepository.save(indexedPublisher);
...@@ -98,8 +104,6 @@ public class PublisherServiceDefault implements PublisherService { ...@@ -98,8 +104,6 @@ public class PublisherServiceDefault implements PublisherService {
98 logger.error("IndexingException {}", e); 104 logger.error("IndexingException {}", e);
99 // TODO Ajouter l'information de manière plus accessible que dans les logs 105 // TODO Ajouter l'information de manière plus accessible que dans les logs
100 } 106 }
101 - publisherActionRepository.save(publisherAction);
102 - return publisherAction;
103 } 107 }
104 108
105 protected void savePublisherVersion(PublisherVersion publisherVersion) { 109 protected void savePublisherVersion(PublisherVersion publisherVersion) {
......