MCPcopy Index your code
hub / github.com/apache/pouchdb / compact

Function compact

lib/index.es.js:5415–5436  ·  view source on GitHub ↗
(revsMap, callback)

Source from the content-addressed store, hash-verified

5413 }
5414
5415 function compact(revsMap, callback) {
5416 var promise = Promise.resolve();
5417 revsMap.forEach(function (revs, docId) {
5418 // TODO: parallelize, for now need to be sequential to
5419 // pass orphaned attachment tests
5420 promise = promise.then(function () {
5421 return new Promise(function (resolve, reject) {
5422 api._doCompactionNoLock(docId, revs, {ctx: txn}, function (err) {
5423 /* istanbul ignore if */
5424 if (err) {
5425 return reject(err);
5426 }
5427 resolve();
5428 });
5429 });
5430 });
5431 });
5432
5433 promise.then(function () {
5434 callback();
5435 }, callback);
5436 }
5437
5438 function autoCompact(callback) {
5439 var revsMap = new Map();

Callers 2

autoCompactFunction · 0.70
finishFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…