Skip to content

Commit

Permalink
#1309 - compact database
Browse files Browse the repository at this point in the history
  • Loading branch information
petmongrels committed Feb 26, 2024
1 parent 51d7414 commit 93de021
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/openchs-android/src/GlobalContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class GlobalContext {

async initialiseGlobalContext(appStore, realmFactory) {
this.db = await realmFactory.createRealm();
this.db.realmDb.compact();

This comment has been minimized.

Copy link
@himeshr

himeshr Feb 26, 2024

Contributor

Shouldn't we compact only when there is lot of unused space in the file.?
https://www.mongodb.com/docs/realm/sdk/react-native/realm-files/compact-realm/#realm-configuration-file

this.beanRegistry.init(this.db);
this.reduxStore = appStore.create(this.beanRegistry.beansMap);
this.beanRegistry.setReduxStore(this.reduxStore);
Expand Down

0 comments on commit 93de021

Please sign in to comment.