From 050c90ab5abc4410e0d8eb3e41960fe764d3ce4a Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Mon, 15 Nov 2021 19:24:01 +0000 Subject: [PATCH 1/8] add bulk updates for these downloads --- modules/eddb/commodities.js | 61 +++++++++++++++++++++-------- modules/eddb/factions.js | 64 ++++++++++++++++++++++--------- modules/eddb/populated_systems.js | 60 ++++++++++++++++++++--------- modules/eddb/stations.js | 62 +++++++++++++++++++++--------- modules/eddb/systems.js | 62 +++++++++++++++++++++--------- 5 files changed, 219 insertions(+), 90 deletions(-) diff --git a/modules/eddb/commodities.js b/modules/eddb/commodities.js index f32d5d0..730467f 100644 --- a/modules/eddb/commodities.js +++ b/modules/eddb/commodities.js @@ -128,12 +128,24 @@ function Commodities() { }) }; + const bulkUpdateCallback = function(err, result){ + if (err) { + console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); + result = err.result; + } + if (result) { + console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); + } + } + this.downloadUpdate = function () { - let recordsUpdated = 0; + let recordsFound = 0; + let operations = []; let stream = utilities.downloadUpdate('https://eddb.io/archive/v6/listings.csv', 'csv'); stream .on('start', response => { console.log(`EDDB commodity dump started with status code ${response.statusCode}`); + console.time('commodity'); this.emit('started', { response: response, insertion: "started", @@ -142,26 +154,41 @@ function Commodities() { }) .on('data', async json => { stream.pause(); - try { - await commoditiesModel.findOneAndUpdate( - { - id: json.id - }, - json, - { - upsert: true, - runValidators: true - }); - recordsUpdated++; - } catch (err) { + json.updated_at = json.updated_at * 1000; + operations.push({ + updateOne: { + filter: { + id: json.id, +// updated_at: { $ne: json.updated_at } + }, + update: { $set: json }, + upsert: true + } + }); + recordsFound++; + if (operations.length % 5000 === 0 ) { + try { + await commoditiesModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + } catch (err) { this.emit('error', err); - } finally { - stream.resume(); + } + operations = []; } + stream.resume(); }) .on('end', () => { - console.log(`${recordsUpdated} records updated`); - this.emit('done', recordsUpdated); + commoditiesModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + console.timeEnd('commodity'); + console.log(`${recordsFound} records processed.`); + this.emit('done', recordsFound); }) .on('error', err => { this.emit('error', err); diff --git a/modules/eddb/factions.js b/modules/eddb/factions.js index a3f5b9e..fd139c8 100644 --- a/modules/eddb/factions.js +++ b/modules/eddb/factions.js @@ -131,12 +131,24 @@ function Factions() { }) }; + const bulkUpdateCallback = function(err, result){ + if (err) { + console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); + result = err.result; + } + if (result) { + console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); + } + } + this.downloadUpdate = function () { - let recordsUpdated = 0; + let recordsFound = 0; + let operations = []; let stream = utilities.downloadUpdate('https://eddb.io/archive/v6/factions.json', 'json'); stream .on('start', response => { console.log(`EDDB faction dump started with status code ${response.statusCode}`); + console.time('faction') this.emit('started', { response: response, insertion: "started", @@ -145,32 +157,46 @@ function Factions() { }) .on('data', async json => { stream.pause(); - try { - await factionsModel.findOneAndUpdate( - { - id: json.id, - updated_at: { $ne: json.updated_at } - }, - json, - { - upsert: true, - runValidators: true - }); - recordsUpdated++; - } catch (err) { + json.updated_at = json.updated_at * 1000; + json.name_lower = json.name.toLowerCase(); + operations.push({ + updateOne: { + filter: { + id: json.id, +// updated_at: { $ne: json.updated_at } + }, + update: { $set: json }, + upsert: true + } + }); + recordsFound++; + if (operations.length % 1000 === 0 ) { + try { + await factionsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + } catch (err) { this.emit('error', err); - } finally { - stream.resume(); + } } + operations = []; + stream.resume(); }) .on('end', () => { - console.log(`${recordsUpdated} records updated`); - this.emit('done', recordsUpdated); + factionsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + console.timeEnd('faction'); + console.log(`${recordsFound} records processed.`); + this.emit('done', recordsFound); }) .on('error', err => { this.emit('error', err); }) } } - inherits(Factions, eventEmmiter); diff --git a/modules/eddb/populated_systems.js b/modules/eddb/populated_systems.js index f8afe42..152515c 100644 --- a/modules/eddb/populated_systems.js +++ b/modules/eddb/populated_systems.js @@ -133,12 +133,24 @@ function PopulatedSystems() { }) }; + const bulkUpdateCallback = function(err, result){ + if (err) { + console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); + result = err.result; + } + if (result) { + console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); + } + } + this.downloadUpdate = function () { - let recordsUpdated = 0; + let recordsFound = 0; + let operations = []; let stream = utilities.downloadUpdate('https://eddb.io/archive/v6/systems_populated.json', 'json'); stream .on('start', response => { console.log(`EDDB populated system dump started with status code ${response.statusCode}`); + console.time('populatedSystems') this.emit('started', { response: response, insertion: "started", @@ -148,27 +160,39 @@ function PopulatedSystems() { .on('data', async json => { stream.pause(); json = modify(json); - try { - await populatedSystemsModel.findOneAndUpdate( - { - id: json.id, - updated_at: { $ne: json.updated_at } - }, - json, - { - upsert: true, - runValidators: true - }); - recordsUpdated++; - } catch (err) { + json.updated_at = json.updated_at * 1000; + operations.push({ + updateOne: { + filter: { + id: json.id, +// updated_at: { $ne: json.updated_at } + }, + update: { $set: json }, + upsert: true + } + }); + recordsFound++; + if (operations.length % 1000 === 0 ) { + try { + await populatedSystemsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + } catch (err) { this.emit('error', err); - } finally { - stream.resume(); + } } + operations = []; + stream.resume(); }) .on('end', () => { - console.log(`${recordsUpdated} records updated`); - this.emit('done', recordsUpdated); + populatedSystemsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + console.timeEnd('populatedSystems'); }) .on('error', err => { this.emit('error', err); diff --git a/modules/eddb/stations.js b/modules/eddb/stations.js index f117b31..26fe3f5 100644 --- a/modules/eddb/stations.js +++ b/modules/eddb/stations.js @@ -133,12 +133,24 @@ function Stations() { }) } + const bulkUpdateCallback = function(err, result){ + if (err) { + console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); + result = err.result; + } + if (result) { + console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); + } + } + this.downloadUpdate = function () { - let recordsUpdated = 0; + let recordsFound = 0; + let operations = []; let stream = utilities.downloadUpdate('https://eddb.io/archive/v6/stations.json', 'json'); stream .on('start', response => { console.log(`EDDB station dump started with status code ${response.statusCode}`); + console.time('stations') this.emit('started', { response: response, insertion: "started", @@ -148,27 +160,41 @@ function Stations() { .on('data', async json => { stream.pause(); json = modify(json); - try { - await stationsModel.findOneAndUpdate( - { - id: json.id, - updated_at: { $ne: json.updated_at } - }, - json, - { - upsert: true, - runValidators: true - }); - recordsUpdated++; - } catch (err) { + json.updated_at = json.updated_at * 1000; + operations.push({ + updateOne: { + filter: { + id: json.id, +// updated_at: { $ne: json.updated_at } + }, + update: { $set: json }, + upsert: true + } + }); + recordsFound++; + if (operations.length % 1000 === 0 ) { + try { + await stationsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + } catch (err) { this.emit('error', err); - } finally { - stream.resume(); + } } + operations = []; + stream.resume(); }) .on('end', () => { - console.log(`${recordsUpdated} records updated`); - this.emit('done', recordsUpdated); + stationsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + console.timeEnd('stations'); + console.log(`${recordsFound} records processed.`); + this.emit('done', recordsFound); }) .on('error', err => { this.emit('error', err); diff --git a/modules/eddb/systems.js b/modules/eddb/systems.js index 19c229f..fe8ee14 100644 --- a/modules/eddb/systems.js +++ b/modules/eddb/systems.js @@ -131,12 +131,24 @@ function Systems() { }) } + const bulkUpdateCallback = function(err, result){ + if (err) { + console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); + result = err.result; + } + if (result) { + console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); + } + } + this.downloadUpdate = function () { - let recordsUpdated = 0; + let recordsFound = 0; + let operations = []; let stream = utilities.downloadUpdate('https://eddb.io/archive/v6/systems.csv', 'csv'); stream .on('start', response => { console.log(`EDDB system dump started with status code ${response.statusCode}`); + console.time('systems') this.emit('started', { response: response, insertion: "started", @@ -145,27 +157,41 @@ function Systems() { }) .on('data', async json => { stream.pause(); - try { - await systemsModel.findOneAndUpdate( - { - id: json.id, - updated_at: { $ne: json.updated_at } - }, - json, - { - upsert: true, - runValidators: true - }); - recordsUpdated++; - } catch (err) { + json.updated_at = json.updated_at * 1000; + operations.push({ + updateOne: { + filter: { + id: json.id, +// updated_at: { $ne: json.updated_at } + }, + update: { $set: json }, + upsert: true + } + }); + recordsFound++; + if (operations.length % 10000 === 0 ) { + try { + await systemsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + } catch (err) { this.emit('error', err); - } finally { - stream.resume(); + } } + operations = []; + stream.resume(); }) .on('end', () => { - console.log(`${recordsUpdated} records updated`); - this.emit('done', recordsUpdated); + systemsModel.bulkWrite( + operations, + { ordered: false }, + bulkUpdateCallback + ); + console.timeEnd('faction'); + console.log(`${recordsFound} records processed.`); + this.emit('done', recordsFound); }) .on('error', err => { this.emit('error', err); From 6d085eecb461d7a22c166b1dbbc5f4c77e398449 Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Mon, 15 Nov 2021 19:38:45 +0000 Subject: [PATCH 2/8] Fix the location of this clearing I had moved to the wrong place --- modules/eddb/factions.js | 2 +- modules/eddb/populated_systems.js | 2 +- modules/eddb/stations.js | 2 +- modules/eddb/systems.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/eddb/factions.js b/modules/eddb/factions.js index fd139c8..0478bbf 100644 --- a/modules/eddb/factions.js +++ b/modules/eddb/factions.js @@ -180,8 +180,8 @@ function Factions() { } catch (err) { this.emit('error', err); } + operations = []; } - operations = []; stream.resume(); }) .on('end', () => { diff --git a/modules/eddb/populated_systems.js b/modules/eddb/populated_systems.js index 152515c..556a0d3 100644 --- a/modules/eddb/populated_systems.js +++ b/modules/eddb/populated_systems.js @@ -182,8 +182,8 @@ function PopulatedSystems() { } catch (err) { this.emit('error', err); } + operations = []; } - operations = []; stream.resume(); }) .on('end', () => { diff --git a/modules/eddb/stations.js b/modules/eddb/stations.js index 26fe3f5..5933fe2 100644 --- a/modules/eddb/stations.js +++ b/modules/eddb/stations.js @@ -182,8 +182,8 @@ function Stations() { } catch (err) { this.emit('error', err); } + operations = []; } - operations = []; stream.resume(); }) .on('end', () => { diff --git a/modules/eddb/systems.js b/modules/eddb/systems.js index fe8ee14..60eaef2 100644 --- a/modules/eddb/systems.js +++ b/modules/eddb/systems.js @@ -179,8 +179,8 @@ function Systems() { } catch (err) { this.emit('error', err); } + operations = []; } - operations = []; stream.resume(); }) .on('end', () => { From c4409b26cd28610611524fdf2f795069e3bc6a94 Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Mon, 15 Nov 2021 19:58:29 +0000 Subject: [PATCH 3/8] readd summary text --- modules/eddb/populated_systems.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/eddb/populated_systems.js b/modules/eddb/populated_systems.js index 556a0d3..cebfa4d 100644 --- a/modules/eddb/populated_systems.js +++ b/modules/eddb/populated_systems.js @@ -193,6 +193,8 @@ function PopulatedSystems() { bulkUpdateCallback ); console.timeEnd('populatedSystems'); + console.log(`${recordsFound} records processed.`); + this.emit('done', recordsFound); }) .on('error', err => { this.emit('error', err); From 2c745849057d837544fbaa6954c0fb7de569d06c Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Tue, 23 Nov 2021 15:17:43 +0000 Subject: [PATCH 4/8] reapply more data modification for bulkWrite --- modules/eddb/commodities.js | 4 ++-- modules/eddb/factions.js | 4 ++-- modules/eddb/populated_systems.js | 3 ++- modules/eddb/stations.js | 11 ++++++++++- modules/eddb/systems.js | 3 ++- modules/utilities/modify.js | 12 +++++++++++- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/modules/eddb/commodities.js b/modules/eddb/commodities.js index 730467f..09d1407 100644 --- a/modules/eddb/commodities.js +++ b/modules/eddb/commodities.js @@ -154,7 +154,7 @@ function Commodities() { }) .on('data', async json => { stream.pause(); - json.updated_at = json.updated_at * 1000; + json.updated_at = utilities.modify.millisecondify(json.updated_at) operations.push({ updateOne: { filter: { @@ -166,7 +166,7 @@ function Commodities() { } }); recordsFound++; - if (operations.length % 5000 === 0 ) { + if (operations.length % 1000 === 0 ) { try { await commoditiesModel.bulkWrite( operations, diff --git a/modules/eddb/factions.js b/modules/eddb/factions.js index 0478bbf..0b06757 100644 --- a/modules/eddb/factions.js +++ b/modules/eddb/factions.js @@ -157,8 +157,8 @@ function Factions() { }) .on('data', async json => { stream.pause(); - json.updated_at = json.updated_at * 1000; - json.name_lower = json.name.toLowerCase(); + json.updated_at = utilities.modify.millisecondify(json.updated_at) + json.name_lower = utilities.modify.lowerify(json.name) operations.push({ updateOne: { filter: { diff --git a/modules/eddb/populated_systems.js b/modules/eddb/populated_systems.js index cebfa4d..6c450b4 100644 --- a/modules/eddb/populated_systems.js +++ b/modules/eddb/populated_systems.js @@ -160,7 +160,8 @@ function PopulatedSystems() { .on('data', async json => { stream.pause(); json = modify(json); - json.updated_at = json.updated_at * 1000; + json.updated_at = utilities.modify.millisecondify(json.updated_at) + json.name_lower = utilities.modify.lowerify(json.name) operations.push({ updateOne: { filter: { diff --git a/modules/eddb/stations.js b/modules/eddb/stations.js index 5933fe2..49e0385 100644 --- a/modules/eddb/stations.js +++ b/modules/eddb/stations.js @@ -160,7 +160,6 @@ function Stations() { .on('data', async json => { stream.pause(); json = modify(json); - json.updated_at = json.updated_at * 1000; operations.push({ updateOne: { filter: { @@ -209,6 +208,16 @@ function Stations() { json.prohibited_commodities = objectify(json.prohibited_commodities); json.economies = objectify(json.economies); json.selling_ships = objectify(json.selling_ships); + json.updated_at = utilities.modify.millisecondify(json.updated_at); + if (json.shipyard_updated_at) { + json.shipyard_updated_at = utilities.modify.millisecondify(json.shipyard_updated_at); + } + if (json.outfitting_updated_at) { + json.outfitting_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); + } + if (json.market_updated_at) { + json.market_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); + } return json; } } diff --git a/modules/eddb/systems.js b/modules/eddb/systems.js index 60eaef2..f79c564 100644 --- a/modules/eddb/systems.js +++ b/modules/eddb/systems.js @@ -157,7 +157,8 @@ function Systems() { }) .on('data', async json => { stream.pause(); - json.updated_at = json.updated_at * 1000; + json.updated_at = utilities.modify.millisecondify(json.updated_at) + json.name_lower = utilities.modify.millisecondify(json.name) operations.push({ updateOne: { filter: { diff --git a/modules/utilities/modify.js b/modules/utilities/modify.js index 046629d..036651a 100644 --- a/modules/utilities/modify.js +++ b/modules/utilities/modify.js @@ -23,4 +23,14 @@ function statify(ref) { return ref; } -module.exports = { objectify, statify } +function millisecondify(ts) { + ts *= 1000; + return ts; +} + +function lowerify(name) { + name = name.toLowerCase(); + return name; +} + +module.exports = { objectify, statify, millisecondify, lowerify } From d4d97a396088613125f4d33ceb327d57b7499043 Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Tue, 23 Nov 2021 17:11:05 +0000 Subject: [PATCH 5/8] reapply more data modification for bulkWrite --- modules/eddb/populated_systems.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/eddb/populated_systems.js b/modules/eddb/populated_systems.js index 6c450b4..528a909 100644 --- a/modules/eddb/populated_systems.js +++ b/modules/eddb/populated_systems.js @@ -160,8 +160,6 @@ function PopulatedSystems() { .on('data', async json => { stream.pause(); json = modify(json); - json.updated_at = utilities.modify.millisecondify(json.updated_at) - json.name_lower = utilities.modify.lowerify(json.name) operations.push({ updateOne: { filter: { @@ -205,10 +203,15 @@ function PopulatedSystems() { let modify = json => { let statify = utilities.modify.statify; json.states = statify(json.states); + json.updated_at = utilities.modify.millisecondify(json.updated_at); + json.name_lower = utilities.modify.lowerify(json.name); json.minor_faction_presences.forEach((minor_faction_presence, index, minor_faction_presences) => { minor_faction_presences[index].active_states = statify(minor_faction_presence.active_states); minor_faction_presences[index].pending_states = statify(minor_faction_presence.pending_states); minor_faction_presences[index].recovering_states = statify(minor_faction_presence.recovering_states); + if (minor_faction_presence.name) { + minor_faction_presences[index].name_lower = utilities.modify.lowerify(minor_faction_presence.name); + } }); return json; } From 57fd3bb0aba1dcb6113ae721c6108322cfa938c7 Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Tue, 23 Nov 2021 18:00:14 +0000 Subject: [PATCH 6/8] move these back out of modify to not break the other update functions --- modules/eddb/populated_systems.js | 4 ++-- modules/eddb/stations.js | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/eddb/populated_systems.js b/modules/eddb/populated_systems.js index 528a909..030c5b2 100644 --- a/modules/eddb/populated_systems.js +++ b/modules/eddb/populated_systems.js @@ -160,6 +160,8 @@ function PopulatedSystems() { .on('data', async json => { stream.pause(); json = modify(json); + json.updated_at = utilities.modify.millisecondify(json.updated_at); + json.name_lower = utilities.modify.lowerify(json.name); operations.push({ updateOne: { filter: { @@ -203,8 +205,6 @@ function PopulatedSystems() { let modify = json => { let statify = utilities.modify.statify; json.states = statify(json.states); - json.updated_at = utilities.modify.millisecondify(json.updated_at); - json.name_lower = utilities.modify.lowerify(json.name); json.minor_faction_presences.forEach((minor_faction_presence, index, minor_faction_presences) => { minor_faction_presences[index].active_states = statify(minor_faction_presence.active_states); minor_faction_presences[index].pending_states = statify(minor_faction_presence.pending_states); diff --git a/modules/eddb/stations.js b/modules/eddb/stations.js index 49e0385..2328284 100644 --- a/modules/eddb/stations.js +++ b/modules/eddb/stations.js @@ -160,6 +160,16 @@ function Stations() { .on('data', async json => { stream.pause(); json = modify(json); + json.updated_at = utilities.modify.millisecondify(json.updated_at); + if (json.shipyard_updated_at) { + json.shipyard_updated_at = utilities.modify.millisecondify(json.shipyard_updated_at); + } + if (json.outfitting_updated_at) { + json.outfitting_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); + } + if (json.market_updated_at) { + json.market_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); + } operations.push({ updateOne: { filter: { @@ -208,16 +218,6 @@ function Stations() { json.prohibited_commodities = objectify(json.prohibited_commodities); json.economies = objectify(json.economies); json.selling_ships = objectify(json.selling_ships); - json.updated_at = utilities.modify.millisecondify(json.updated_at); - if (json.shipyard_updated_at) { - json.shipyard_updated_at = utilities.modify.millisecondify(json.shipyard_updated_at); - } - if (json.outfitting_updated_at) { - json.outfitting_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); - } - if (json.market_updated_at) { - json.market_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); - } return json; } } From 1c8765d4c0f236b5a998e85d53eca2b61dae8ccd Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Tue, 23 Nov 2021 19:35:31 +0000 Subject: [PATCH 7/8] update the correct property --- modules/eddb/stations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/eddb/stations.js b/modules/eddb/stations.js index 2328284..05f3b2a 100644 --- a/modules/eddb/stations.js +++ b/modules/eddb/stations.js @@ -168,7 +168,7 @@ function Stations() { json.outfitting_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); } if (json.market_updated_at) { - json.market_updated_at = utilities.modify.millisecondify(json.outfitting_updated_at); + json.market_updated_at = utilities.modify.millisecondify(json.market_updated_at); } operations.push({ updateOne: { From 3d54e9f63691f2c8ebc21fbaa0d15b2112b946fb Mon Sep 17 00:00:00 2001 From: forbiddenlake Date: Tue, 23 Nov 2021 21:35:29 +0000 Subject: [PATCH 8/8] hide the spammy DB insertion messages --- modules/eddb/commodities.js | 7 ++++--- modules/eddb/factions.js | 6 +++--- modules/eddb/populated_systems.js | 6 +++--- modules/eddb/stations.js | 6 +++--- modules/eddb/systems.js | 6 +++--- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/eddb/commodities.js b/modules/eddb/commodities.js index 09d1407..29a96c7 100644 --- a/modules/eddb/commodities.js +++ b/modules/eddb/commodities.js @@ -133,9 +133,10 @@ function Commodities() { console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); result = err.result; } - if (result) { - console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); - } + // Uncomment for database insertion progress +// if (result) { +// console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); +// } } this.downloadUpdate = function () { diff --git a/modules/eddb/factions.js b/modules/eddb/factions.js index 0b06757..fc5d01d 100644 --- a/modules/eddb/factions.js +++ b/modules/eddb/factions.js @@ -136,9 +136,9 @@ function Factions() { console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); result = err.result; } - if (result) { - console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); - } +// if (result) { +// console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); +// } } this.downloadUpdate = function () { diff --git a/modules/eddb/populated_systems.js b/modules/eddb/populated_systems.js index 030c5b2..402c84e 100644 --- a/modules/eddb/populated_systems.js +++ b/modules/eddb/populated_systems.js @@ -138,9 +138,9 @@ function PopulatedSystems() { console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); result = err.result; } - if (result) { - console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); - } +// if (result) { +// console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); +// } } this.downloadUpdate = function () { diff --git a/modules/eddb/stations.js b/modules/eddb/stations.js index 05f3b2a..5cd158a 100644 --- a/modules/eddb/stations.js +++ b/modules/eddb/stations.js @@ -138,9 +138,9 @@ function Stations() { console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); result = err.result; } - if (result) { - console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); - } +// if (result) { +// console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); +// } } this.downloadUpdate = function () { diff --git a/modules/eddb/systems.js b/modules/eddb/systems.js index f79c564..c31f0ad 100644 --- a/modules/eddb/systems.js +++ b/modules/eddb/systems.js @@ -136,9 +136,9 @@ function Systems() { console.log(`Errors: ${err.result.getWriteErrorCount()}, example: ${err.message}`); result = err.result; } - if (result) { - console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); - } +// if (result) { +// console.log(`${result.insertedCount} inserted, ${result.matchedCount} matched, ${result.modifiedCount} modified, ${result.upsertedCount} upserted`); +// } } this.downloadUpdate = function () {