Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multiple small bugs after #379 #380

Merged
merged 2 commits into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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