Skip to content

Commit

Permalink
fix(bootstrap): move to production only in bootstrap (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvo committed Feb 12, 2018
1 parent c79e6cd commit b26dce6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ mainIndex
.then(({ taskID }) => mainIndex.waitTask(taskID))
.then(() => stateManager.check())
.then(bootstrap)
.then(moveToProduction)
.then(() => stateManager.get())
.then(replicate)
.then(() => stateManager.get())
Expand Down Expand Up @@ -108,13 +107,15 @@ async function bootstrap(state) {
return_docs: false, // eslint-disable-line camelcase
limit: c.bootstrapConcurrency,
})
.then(res => {
.then(async res => {
if (res.rows.length === 0) {
log.info('⛷ Bootstrap: done');
return stateManager.save({
await stateManager.save({
bootstrapDone: true,
bootstrapLastDone: Date.now(),
});

return moveToProduction();
}

const newLastId = res.rows[res.rows.length - 1].id;
Expand Down

0 comments on commit b26dce6

Please sign in to comment.