Skip to content

Commit c66b1ff

Browse files
committed
Add comment clarifing futures wait time.
1 parent 48cefce commit c66b1ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

firestore/src/main/java/com/example/firestore/snippets/QueryDataSnippets.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void createMultipleCursorConditionsQuery() {
344344
Query createStartAtSnapshotQueryCursor()
345345
throws InterruptedException, ExecutionException, TimeoutException {
346346
// [START fs_document_snapshot_cursor]
347-
// Fetch the Snapshot
347+
// Fetch the snapshot with an API call, waiting for a maximum of 30 seconds for a result.
348348
ApiFuture<DocumentSnapshot> future = db.collection("cities").document("SF").get();
349349
DocumentSnapshot snapshot = future.get(30, TimeUnit.SECONDS);
350350

@@ -368,7 +368,7 @@ void paginateCursor() throws InterruptedException, ExecutionException, TimeoutEx
368368
.limit(25)
369369
.get();
370370

371-
// Wait for results.
371+
// Wait for the results of the API call, waiting for a maximum of 30 seconds for a result.
372372
List<QueryDocumentSnapshot> docs = firstPage.get(30, TimeUnit.SECONDS).getDocuments();
373373

374374
// Construct query for the next 25 cities.

0 commit comments

Comments
 (0)