From 4cbde4529300f189255793e61a14194f0f287bef Mon Sep 17 00:00:00 2001 From: joe fleming Date: Wed, 30 Jan 2019 10:00:04 -0700 Subject: [PATCH] fix: make output less chatty --- bin/index.js | 1 - src/index.mjs | 1 - src/lib/data-source.mjs | 4 +--- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/index.js b/bin/index.js index 41e3a0a..276909d 100644 --- a/bin/index.js +++ b/bin/index.js @@ -34,7 +34,6 @@ function handleError(err) { } async function fetchAndIndex() { - logger.debug('Fetching and indexing data...'); return mod(index, { elasticsearch: { ...esConfig, auth }, filter: { lat, lon, radius } }); } diff --git a/src/index.mjs b/src/index.mjs index 4149031..f6811f7 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -17,7 +17,6 @@ export default async function(indexName, opts = {}) { const index = await createIndex(client, indexName); const records = await getAdbsExchangeData(opts.filter); - logger.debug(`Record count:, ${records.length}`); await bulkInsert(client, index, records); logger.debug(`Successfully indexed ${records.length} records to ${index}`); diff --git a/src/lib/data-source.mjs b/src/lib/data-source.mjs index 4b84e6e..1692965 100644 --- a/src/lib/data-source.mjs +++ b/src/lib/data-source.mjs @@ -58,10 +58,8 @@ export async function createIndex(client, index) { }) .catch(err => { // check for existing index - if (err instanceof BadRequest) { - logger.debug(`Index exists: ${realIndex}`); + if (err instanceof BadRequest) return client.indices.get({ index: realIndex }).then(() => realIndex); - } throw err; });