fix NaN bug

This commit is contained in:
2020-05-29 18:59:22 +02:00
parent a245d8b392
commit e69539957e

View File

@@ -39,8 +39,8 @@ const getFullData = async url => {
if (marketData.status === 200) {
marketData = await marketData.json();
let foundQ = [false, false, false, false, false, false, false];
let mCapSum = [0, 0, 0, 0, 0, 0, 0];
let mCapCount = [0, 0, 0, 0, 0, 0, 0];
let mCapSum = [0, 0, 0, 0, 0, 0, 0, 0];
let mCapCount = [0, 0, 0, 0, 0, 0, 0, 0];
let res = [];
for (let t2 = 0; t2 < marketData.length; t2++) {
if (marketData[t2].quality <= 7) {
@@ -112,16 +112,17 @@ const storeFullData = async marketData => {
connection.commit(function (err) {
if (err) {
tgBot.sendMessage(tgInfo.debugChat, 'ERROR: commit failed.');
return connection.rollback(function () {
connection.end();
throw err;
});
} else {
connection.end();
tgBot.sendMessage(tgInfo.debugChat, 'INF: dataminer successfully stored new prices.');
return connection.end();
}
});
});
tgBot.sendMessage(tgInfo.debugChat, 'INF: dataminer successfully stored new prices.');
}
storeFullData(getFullData());