Skip to content

Commit

Permalink
fix: block close() on the termination of all RPC channels
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Jan 26, 2021
1 parent 0e6f3da commit 2944191
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -66,6 +66,7 @@
import java.io.IOException;
import java.util.Collections;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
* GRPC client implementation of the Firestore RPC methods. Exposes FirestoreOptions on top of the
Expand Down Expand Up @@ -152,6 +153,9 @@ public void close() throws Exception {
for (BackgroundResource resource : clientContext.getBackgroundResources()) {
resource.close();
}
for (BackgroundResource resource : clientContext.getBackgroundResources()) {
resource.awaitTermination(1, TimeUnit.SECONDS);
}
executorFactory.release(executor);
}

Expand Down

0 comments on commit 2944191

Please sign in to comment.