diff --git a/lib/services/db.js b/lib/services/db.js index 3161f43d..e8d6d6c5 100644 --- a/lib/services/db.js +++ b/lib/services/db.js @@ -130,6 +130,7 @@ module.exports.registerStorage = registerStorage; module.exports.put; module.exports.get; module.exports.del; +module.exports.applyLock; module.exports.batch; module.exports.putMeta; module.exports.patchMeta; diff --git a/lib/setup.js b/lib/setup.js index 9dcc0e12..947195a3 100644 --- a/lib/setup.js +++ b/lib/setup.js @@ -64,7 +64,10 @@ module.exports = function (options = {}) { .then(() => db.registerStorage(storage)) .then(() => amphoraPlugins.registerPlugins(plugins)) .then(() => { router = routes(app, providers, sessionStore); }) - .then(() => internalBootstrap(bootstrap)) + .then(() => + db.applyLock + ? db.applyLock('bootstrap', internalBootstrap) + : internalBootstrap(bootstrap)) .then(() => router); };