From ca343324aee20126026984bfd3322fbaab2b1bf4 Mon Sep 17 00:00:00 2001 From: Rainer Prosi Date: Tue, 1 Oct 2024 11:05:12 +0200 Subject: [PATCH] fix logging --- .../java/org/cip4/bambi/core/AbstractDevice.java | 16 +++++----------- .../java/org/cip4/bambi/BambiTestDevice.java | 7 +++++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/cip4/bambi/core/AbstractDevice.java b/src/main/java/org/cip4/bambi/core/AbstractDevice.java index 03713c2a..fc044b53 100644 --- a/src/main/java/org/cip4/bambi/core/AbstractDevice.java +++ b/src/main/java/org/cip4/bambi/core/AbstractDevice.java @@ -2421,18 +2421,12 @@ public SingleProcess(final AbstractDeviceProcessor p) @Override public void run() { + incNumRequests(); final boolean result = p.processExistingQueueEntry(); - p.stopProcessing(result ? EnumNodeStatus.Completed : EnumNodeStatus.Aborted); - log.info("completed processing " + getQueueProcessor().getTotalEntryCount()); - for (final Object o : EnumQueueEntryStatus.getEnumList()) - { - final EnumQueueEntryStatus s = (EnumQueueEntryStatus) o; - final int numEntries = getQueueProcessor().getQueue().numEntries(s); - if (numEntries > 0) - { - log.info("completed processing " + s.getName() + " " + numEntries); - } - } + final EnumNodeStatus newStatus = result ? EnumNodeStatus.Completed : EnumNodeStatus.Aborted; + p.stopProcessing(newStatus); + final JDFQueue queue = getQueueProcessor().getQueue(); + log.info(newStatus.getName() + " processing " + queue.numEntries(EnumQueueEntryStatus.getEnum(newStatus.getName())) + " / " + getQueueProcessor().getTotalEntryCount()); } } diff --git a/src/test/java/org/cip4/bambi/BambiTestDevice.java b/src/test/java/org/cip4/bambi/BambiTestDevice.java index 83da751b..80743453 100644 --- a/src/test/java/org/cip4/bambi/BambiTestDevice.java +++ b/src/test/java/org/cip4/bambi/BambiTestDevice.java @@ -74,6 +74,7 @@ import org.cip4.bambi.workers.WorkerDeviceProcessor; import org.cip4.bambi.workers.sim.SimDeviceProcessor; import org.cip4.jdflib.auto.JDFAutoQueueEntry.EnumQueueEntryStatus; +import org.cip4.jdflib.jmf.JDFQueue; import org.cip4.jdflib.util.ContainerUtil; public class BambiTestDevice extends WorkerDevice @@ -96,8 +97,10 @@ public BambiTestDevice() { super(new BambiTestProp()); sim = false; - getQueueProcessor().getQueue().resumeQueue(); - getQueueProcessor().getQueue().openQueue(); + JDFQueue queue = getQueueProcessor().getQueue(); + queue.resumeQueue(); + queue.openQueue(); + queue.flush(); finalStatus = EnumQueueEntryStatus.Completed; }