Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
feat: Enabled autocompaction and set index for nedb driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Sierociński committed Aug 28, 2019
1 parent eab5348 commit e284679
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/db-drivers/nedb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class NeDBDriver extends AbstractDriver {
constructor (settings) {
super(settings);
this.config = Object.deepAssign({}, DEFAULT_CONFIG, this.settings);

this.datastore = new Datastore(this.config);

this.datastore.persistence.setAutocompactionInterval(30 * Date.MINUTE);
this.datastore.ensureIndex({ fieldName: 'sid' });
}

/**
Expand Down

0 comments on commit e284679

Please sign in to comment.