Skip to content

Commit 270f726

Browse files
committed
fix(batch): add OPENED state for when the stream hasn't been started
1 parent 1a4645d commit 270f726

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchContext.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void setClosing(Exception ex) {
173173

174174
this.queue = new ArrayBlockingQueue<>(DEFAULT_QUEUE_SIZE);
175175
this.batch = new Batch(DEFAULT_BATCH_SIZE, maxSizeBytes);
176-
setState(CLOSED);
176+
setState(OPENED);
177177

178178
}
179179

@@ -835,6 +835,13 @@ List<Runnable> shutdownNow() {
835835
}
836836
}
837837

838+
final State OPENED = new BaseState("OPENED") {
839+
@Override
840+
public void onEnter(State prev) {
841+
closed = false;
842+
}
843+
};
844+
838845
final State CLOSED = new BaseState("CLOSED") {
839846
@Override
840847
public void onEnter(State prev) {

0 commit comments

Comments
 (0)