From 2e90ea7a81e8d1469dc05848639ff0377e81100f Mon Sep 17 00:00:00 2001 From: "bryan.zhang" Date: Fri, 5 Jan 2018 19:25:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=B5=81=E7=A8=8B=E4=B8=AD?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=9A=84=E5=A2=9E=E8=A1=A5=E5=92=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/thebeastshop/liteflow/core/FlowExecutor.java | 7 +++---- .../com/thebeastshop/liteflow/entity/data/DataBus.java | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/thebeastshop/liteflow/core/FlowExecutor.java b/src/main/java/com/thebeastshop/liteflow/core/FlowExecutor.java index 4abd42bde..d86914817 100644 --- a/src/main/java/com/thebeastshop/liteflow/core/FlowExecutor.java +++ b/src/main/java/com/thebeastshop/liteflow/core/FlowExecutor.java @@ -67,6 +67,7 @@ public class FlowExecutor { } public T execute(String chainId,Object param,Class slotClazz,Integer slotIndex,boolean isInnerChain){ + Slot slot = null; try{ if(FlowBus.needInit()) { init(); @@ -88,7 +89,7 @@ public class FlowExecutor { throw new NoAvailableSlotException("there is no available slot"); } - Slot slot = DataBus.getSlot(slotIndex); + slot = DataBus.getSlot(slotIndex); if(slot == null) { throw new NoAvailableSlotException("the slot is not exist"); } @@ -137,15 +138,13 @@ public class FlowExecutor { latch.await(15, TimeUnit.SECONDS); } } - if(!isInnerChain) { - slot.printStep(); - } return (T)slot; }catch(Exception e){ LOG.error("executor cause error",e); throw new FlowSystemException("executor cause error"); }finally{ if(!isInnerChain) { + slot.printStep(); DataBus.releaseSlot(slotIndex); } } diff --git a/src/main/java/com/thebeastshop/liteflow/entity/data/DataBus.java b/src/main/java/com/thebeastshop/liteflow/entity/data/DataBus.java index de9eb4a10..dceac9c16 100644 --- a/src/main/java/com/thebeastshop/liteflow/entity/data/DataBus.java +++ b/src/main/java/com/thebeastshop/liteflow/entity/data/DataBus.java @@ -49,6 +49,7 @@ public class DataBus { if(slots[slotIndex] != null){ slots[slotIndex] = null; OCCUPY_COUNT.decrementAndGet(); + LOG.info("the slot[{}] released",slotIndex); }else{ LOG.warn("the slot[{}] has been released",slotIndex); }