Skip to content

Commit

Permalink
fix: multiple small bugs after #379 (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Aug 6, 2019
1 parent aa0b14b commit 0580052
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ async function bootstrapLoop(lastId) {
options.skip = 1;
}

const res = await npm.findAll({
options,
});
const res = await npm.findAll(options);

if (res.rows.length <= 0) {
// Nothing left to process
Expand All @@ -171,7 +169,7 @@ async function bootstrapLoop(lastId) {
const newLastId = res.rows[res.rows.length - 1].id;

const saved = await saveDocs({ docs: res.rows, index: bootstrapIndex });
stateManager.save({
await stateManager.save({
bootstrapLastId: newLastId,
});
log.info(` - saved ${saved} packages`);
Expand Down Expand Up @@ -216,6 +214,7 @@ async function replicate({ seq }) {

const changesConsumer = cargo(async docs => {
datadog.increment('packages', docs.length);
log.info(`🐌 Replicate received ${docs.length} packages`);

try {
await saveDocs({ docs, index: mainIndex });
Expand Down Expand Up @@ -276,6 +275,7 @@ async function watch({ seq }) {

const changesConsumer = queue(async change => {
datadog.increment('packages');
log.info(`🛰 Watch received 1 packages`);

try {
await saveDocs({ docs: [change], index: mainIndex });
Expand Down
2 changes: 1 addition & 1 deletion src/npm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import numeral from 'numeral';

import config from '../config.js';
import datadog from '../datadog.js';
import log from '../log';
import log from '../log.js';

const db = new PouchDB(config.npmRegistryEndpoint, {
ajax: {
Expand Down

0 comments on commit 0580052

Please sign in to comment.