diff options
-rw-r--r-- | src/main/java/org/onap/aai/spike/service/SpikeEventProcessor.java | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/onap/aai/spike/service/SpikeEventProcessor.java b/src/main/java/org/onap/aai/spike/service/SpikeEventProcessor.java index 88fa716..cd404b0 100644 --- a/src/main/java/org/onap/aai/spike/service/SpikeEventProcessor.java +++ b/src/main/java/org/onap/aai/spike/service/SpikeEventProcessor.java @@ -246,6 +246,8 @@ public class SpikeEventProcessor extends TimerTask { || eventQueue.size() > eventQueueCapacity)) { event = eventQueue.take(); } else { + // Small pause so that we aren't burning CPU + Thread.sleep(200); continue; } diff --git a/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java b/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java index 22626e7..2190942 100644 --- a/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java +++ b/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java @@ -33,7 +33,7 @@ public class OffsetManagerTest { @Test public void testOffsetAdvancement() throws Exception { - final Long offsetPeriod = 50L; // ms + final Long offsetPeriod = 500L; // ms // Create an instance of the offset manager. OffsetManager offsetManager = new OffsetManager(10, offsetPeriod); |