WIP: use async functions from persistence module in datastore

pull/11/head
Timothée Rebours 3 years ago
parent 4d900da6fe
commit 7f78b403ae
  1. 7
      lib/datastore.js

@ -610,12 +610,7 @@ class Datastore extends EventEmitter {
// Update the datafile // Update the datafile
const updatedDocs = modifications.map(x => x.newDoc) const updatedDocs = modifications.map(x => x.newDoc)
await new Promise((resolve, reject) => { await this.persistence.persistNewStateAsync(updatedDocs)
this.persistence.persistNewState(updatedDocs, err => {
if (err) return reject(err)
else resolve()
})
})
if (!options.returnUpdatedDocs) return { numAffected: numReplaced } if (!options.returnUpdatedDocs) return { numAffected: numReplaced }
else { else {
let updatedDocsDC = [] let updatedDocsDC = []

Loading…
Cancel
Save