Skip to content

Commit

Permalink
fix: block close() on the termination of all RPC channels (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Feb 11, 2021
1 parent 6841cd5 commit 67bd06a
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 67bd06a

Please sign in to comment.