Skip to content

Commit

Permalink
Clean up the error
Browse files Browse the repository at this point in the history
  • Loading branch information
boney9 committed Oct 10, 2022
1 parent abbfd0b commit 9a50ebd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/io/orkes/conductor/client/grpc/PooledPoller.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,12 @@ public void onCompleted() {

private void drain() {
long didntGetMessageCount = lastAskedForMessageCount.get();
log.info("Didn't get {} messages", didntGetMessageCount);
for (int i = 0; i < didntGetMessageCount; i++) {
this.saveTask(TaskPb.Task.newBuilder().setTaskId("NO_OP").build());
semaphore.release();
if(didntGetMessageCount > 0) {
log.info("Didn't get {} messages from server as expected", didntGetMessageCount);
for (int i = 0; i < didntGetMessageCount; i++) {
this.saveTask(TaskPb.Task.newBuilder().setTaskId("NO_OP").build());
semaphore.release();
}
}
callAgain.set(true);
}
Expand Down

0 comments on commit 9a50ebd

Please sign in to comment.