Skip to content

Commit 720d3a2

Browse files
committed
fix MLOS-268
1 parent 4589cb2 commit 720d3a2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs/EvalProcessingWorker.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,14 @@ public void run() {
145145
private void runDutyCycle() throws InterruptedException {
146146
Thread thread = Thread.currentThread();
147147
while (!thread.isInterrupted()) {
148-
consumeBatch();
149-
flushIfNecessary();
148+
LLMObsEval eval = queue.poll(ticksRequiredToFlush, TimeUnit.NANOSECONDS);
149+
if (eval != null) {
150+
buffer.add(eval);
151+
consumeBatch();
152+
flushIfNecessary();
153+
} else if (!buffer.isEmpty()) {
154+
flushIfNecessary();
155+
}
150156
}
151157
}
152158

0 commit comments

Comments
 (0)