feat: use ads-b exchange data
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user