From e860ee1e2070b8fde64994ee033720d203f6a284 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Mon, 23 Jul 2018 01:08:08 +0100 Subject: [PATCH] log event seqNo and timestamp. Fix synchronization --- core/src/main/groovy/com/muwire/core/EventBus.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/EventBus.groovy b/core/src/main/groovy/com/muwire/core/EventBus.groovy index 5b43ca1f..d10ed868 100644 --- a/core/src/main/groovy/com/muwire/core/EventBus.groovy +++ b/core/src/main/groovy/com/muwire/core/EventBus.groovy @@ -11,10 +11,10 @@ class EventBus { private Map handlers = new HashMap() void publish(Event e) { - log.fine "publishing event of type ${e.getClass().getSimpleName()}" + log.fine "publishing event of type ${e.getClass().getSimpleName()} seqNo ${e.seqNo} timestamp ${e.timestamp}" def currentHandlers final def clazz = e.getClass() - synchronized(handlers) { + synchronized(this) { currentHandlers = handlers.getOrDefault(clazz, []) } currentHandlers.each {