fix stack overflow

pull/53/head
Chris Wendt 11 months ago
parent 68279ccdf0
commit c2b7768c8a
  1. 4
      lib/datastore.js

@ -668,7 +668,7 @@ class Datastore extends EventEmitter {
* @private
*/
async _getCandidatesAsync (query, dontExpireStaleDocs = false) {
const validDocs = []
let validDocs = []
// STEP 1: get candidates list by checking indexes from most to least frequent usecase
const docs = this._getRawCandidates(query)
@ -684,7 +684,7 @@ class Datastore extends EventEmitter {
for (const _id of expiredDocsIds) {
await this._removeAsync({ _id }, {})
}
} else validDocs.push(...docs)
} else validDocs = docs
return validDocs
}

Loading…
Cancel
Save