feat: use ads-b exchange data

This commit is contained in:
2018-11-02 14:54:47 -07:00
parent 9f0da54ccf
commit 89261d0010
2 changed files with 7 additions and 5 deletions

View File

@@ -1,8 +1,7 @@
import elasticsearch from 'elasticsearch';
import logger from './lib/logger.mjs';
import { createIndex, bulkInsert } from './lib/data-source.mjs';
import { getOpenskyData } from './lib/get-data.mjs';
import { getAdbsExchangeData } from './lib/get-data.mjs';
export default async function(indexName, opts = {}) {
const client = new elasticsearch.Client({
@@ -17,7 +16,7 @@ export default async function(indexName, opts = {}) {
// create the target index
const index = await createIndex(client, indexName);
const records = await getOpenskyData();
const records = await getAdbsExchangeData(opts.filter);
logger.debug(`Record count:, ${records.length}`);
await bulkInsert(client, index, records);