Log dispatch refactoring
This commit is contained in:
@@ -41,10 +41,7 @@ public class EventPipelineTask {
|
||||
|
||||
RegisteredEventHandler handler = handlers.get(currentIndex);
|
||||
if (!event.isCanceled() || !handler.isIgnoreCancelled()) {
|
||||
List<Lock> locks = new ArrayList<>();
|
||||
|
||||
if (handler.isPluginSynchronize())
|
||||
locks.add(manager.getResourceManager().getPluginLock(handler.getPlugin()));
|
||||
List<Lock> locks = getLocks(handler);
|
||||
|
||||
service.addTask(new ResourceRunnable() {
|
||||
@Override
|
||||
@@ -73,6 +70,16 @@ public class EventPipelineTask {
|
||||
}
|
||||
}
|
||||
|
||||
private List<Lock> getLocks(RegisteredEventHandler handler) {
|
||||
List<Lock> locks = new ArrayList<>();
|
||||
|
||||
if (handler.isPluginSynchronize())
|
||||
locks.add(manager.getResourceManager().getPluginLock(handler.getPlugin()));
|
||||
|
||||
|
||||
return locks;
|
||||
}
|
||||
|
||||
public enum PipelineState {
|
||||
IDLE, WORKING, FINISHED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user