Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 878e636

Browse files
authored
Merge pull request firebase#456 from firebase/mc/cache
fix bad cache size in snippets
2 parents 5e898fc + 5377f07 commit 878e636

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

firestore/app/src/main/java/com/google/example/firestore/DocSnippets.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public void setupCacheSize() {
148148
FirebaseFirestoreSettings settings =
149149
new FirebaseFirestoreSettings.Builder(db.getFirestoreSettings())
150150
.setLocalCacheSettings(PersistentCacheSettings.newBuilder()
151-
// Set size to 1 MB
152-
.setSizeBytes(1_000_000)
151+
// Set size to 100 MB
152+
.setSizeBytes(1024 * 1024 * 100)
153153
.build())
154154
.build();
155155
db.setFirestoreSettings(settings);

firestore/app/src/main/java/com/google/example/firestore/kotlin/DocSnippets.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ abstract class DocSnippets(val db: FirebaseFirestore) {
124124
// [START fs_setup_cache]
125125
val settings = firestoreSettings {
126126
setLocalCacheSettings(persistentCacheSettings {
127-
// Set size to 1 MB
128-
setSizeBytes(1000000)
127+
// Set size to 100 MB
128+
setSizeBytes(1024 * 1024 * 100)
129129
})
130130
}
131131
db.firestoreSettings = settings

0 commit comments

Comments
 (0)