Remove Async annotation on event listeners

pull/151/head
johnniang 2019-05-10 15:26:06 +08:00
parent fdff4640cd
commit f9be43731d
3 changed files with 7 additions and 7 deletions

View File

@ -74,6 +74,8 @@ public class CommentEventListener {
// Get postComment id // Get postComment id
PostComment postComment = postCommentService.getById(newEvent.getCommentId()); PostComment postComment = postCommentService.getById(newEvent.getCommentId());
log.debug("Got post comment: [{}]", postComment);
Post post = postService.getById(postComment.getPostId()); Post post = postService.getById(postComment.getPostId());
StrBuilder url = new StrBuilder(optionService.getBlogBaseUrl()) StrBuilder url = new StrBuilder(optionService.getBlogBaseUrl())
@ -86,6 +88,8 @@ public class CommentEventListener {
} else if (newEvent.getSource() instanceof SheetService) { } else if (newEvent.getSource() instanceof SheetService) {
SheetComment sheetComment = sheetCommentService.getById(newEvent.getCommentId()); SheetComment sheetComment = sheetCommentService.getById(newEvent.getCommentId());
log.debug("Got sheet comment: [{}]", sheetComment);
Sheet sheet = sheetService.getById(sheetComment.getPostId()); Sheet sheet = sheetService.getById(sheetComment.getPostId());
StrBuilder url = new StrBuilder(optionService.getBlogBaseUrl()) StrBuilder url = new StrBuilder(optionService.getBlogBaseUrl())
@ -98,6 +102,8 @@ public class CommentEventListener {
} else if (newEvent.getSource() instanceof JournalService) { } else if (newEvent.getSource() instanceof JournalService) {
JournalComment journalComment = journalCommentService.getById(newEvent.getCommentId()); JournalComment journalComment = journalCommentService.getById(newEvent.getCommentId());
log.debug("Got journal comment: [{}]", journalComment);
Journal journal = journalService.getById(journalComment.getPostId()); Journal journal = journalService.getById(journalComment.getPostId());
StrBuilder url = new StrBuilder(optionService.getBlogBaseUrl()) StrBuilder url = new StrBuilder(optionService.getBlogBaseUrl())
@ -133,7 +139,7 @@ public class CommentEventListener {
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
log.debug("replyEvent.getSource():"+replyEvent.getSource().toString()); log.debug("replyEvent.getSource():" + replyEvent.getSource().toString());
if (replyEvent.getSource() instanceof PostCommentService) { if (replyEvent.getSource() instanceof PostCommentService) {

View File

@ -49,7 +49,6 @@ public class FreemarkerConfigAwareListener {
this.userService = userService; this.userService = userService;
} }
@Async
@EventListener @EventListener
@Order(Ordered.HIGHEST_PRECEDENCE + 1) @Order(Ordered.HIGHEST_PRECEDENCE + 1)
public void onApplicationStartedEvent(ApplicationStartedEvent applicationStartedEvent) throws TemplateModelException { public void onApplicationStartedEvent(ApplicationStartedEvent applicationStartedEvent) throws TemplateModelException {
@ -60,7 +59,6 @@ public class FreemarkerConfigAwareListener {
loadUserConfig(); loadUserConfig();
} }
@Async
@EventListener @EventListener
public void onThemeActivatedEvent(ThemeActivatedEvent themeActivatedEvent) throws TemplateModelException { public void onThemeActivatedEvent(ThemeActivatedEvent themeActivatedEvent) throws TemplateModelException {
log.debug("Received theme activated event"); log.debug("Received theme activated event");
@ -68,7 +66,6 @@ public class FreemarkerConfigAwareListener {
loadThemeConfig(); loadThemeConfig();
} }
@Async
@EventListener @EventListener
public void onUserUpdate(UserUpdatedEvent event) throws TemplateModelException { public void onUserUpdate(UserUpdatedEvent event) throws TemplateModelException {
log.debug("Received user updated event, user id: [{}]", event.getUserId()); log.debug("Received user updated event, user id: [{}]", event.getUserId());
@ -76,7 +73,6 @@ public class FreemarkerConfigAwareListener {
loadUserConfig(); loadUserConfig();
} }
@Async
@EventListener @EventListener
public void onOptionUpdate(OptionUpdatedEvent event) throws TemplateModelException { public void onOptionUpdate(OptionUpdatedEvent event) throws TemplateModelException {
log.debug("Received option updated event"); log.debug("Received option updated event");

View File

@ -22,13 +22,11 @@ public class ThemeUpdatedListener {
this.cacheStore = cacheStore; this.cacheStore = cacheStore;
} }
@Async
@EventListener @EventListener
public void onApplicationEvent(ThemeUpdatedEvent event) { public void onApplicationEvent(ThemeUpdatedEvent event) {
cacheStore.delete(ThemeService.THEMES_CACHE_KEY); cacheStore.delete(ThemeService.THEMES_CACHE_KEY);
} }
@Async
@EventListener @EventListener
public void onOptionUpdatedEvent(OptionUpdatedEvent optionUpdatedEvent) { public void onOptionUpdatedEvent(OptionUpdatedEvent optionUpdatedEvent) {
cacheStore.delete(ThemeService.THEMES_CACHE_KEY); cacheStore.delete(ThemeService.THEMES_CACHE_KEY);