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; });