diff --git a/gather/src/index.js b/gather/src/index.js index 0a32310..e0ec3ee 100644 --- a/gather/src/index.js +++ b/gather/src/index.js @@ -11,15 +11,16 @@ async function initDB () { await initDB() for (const item of items) { - console.log(`Looking at ${item.name}`) + process.stdout.write(`Looking at ${item.name}: `) let partsPrice = 0 for (const part of item.parts) { + process.stdout.write(`${part.part} `) partsPrice += await part.getPrice() } const setPrice = await item.set.getPrice() - models.ScanResult.findOneAndUpdate( + await models.ScanResult.findOneAndUpdate( { name: item.name }, { fullName: item.fullName, @@ -29,8 +30,11 @@ async function initDB () { setPrice, difference: setPrice - partsPrice }, - { upsert: true }, - () => {} + { upsert: true } ) + + console.log('✅') } + + await mongoose.disconnect() })()