Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rainer-prosi committed Oct 1, 2024
1 parent 71aed16 commit ca34332
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
16 changes: 5 additions & 11 deletions src/main/java/org/cip4/bambi/core/AbstractDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/test/java/org/cip4/bambi/BambiTestDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

}
Expand Down

0 comments on commit ca34332

Please sign in to comment.