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); }