This commit is contained in:
sairajzero 2022-02-06 01:47:23 +05:30
parent a75fbc067f
commit 75064ad4c0

View File

@ -170,7 +170,7 @@ function readAppSubAdminListFromAPI(base) {
for (let app in base.appList) { for (let app in base.appList) {
promises.push(new Promise((resolve, reject) => { promises.push(new Promise((resolve, reject) => {
floBlockchainAPI.readData(base.appList[app], { floBlockchainAPI.readData(base.appList[app], {
ignoreOld: base.lastTx[`${app}_${base.appList[app]}`] || 0, ignoreOld: base.lastTx[base.appList[app]] || 0,
sentOnly: true, sentOnly: true,
pattern: app pattern: app
}).then(result => { }).then(result => {
@ -184,7 +184,7 @@ function readAppSubAdminListFromAPI(base) {
}); });
base.appSubAdmins[app] = Array.from(subAdmins); base.appSubAdmins[app] = Array.from(subAdmins);
Promise.allSettled([ Promise.allSettled([
DB.setLastTx(`${app}_${base.appList[app]}`, result.totalTxs), DB.setLastTx(base.appList[app], result.totalTxs),
DB.setSubAdmin(app, base.appSubAdmins[app]) DB.setSubAdmin(app, base.appSubAdmins[app])
]).then(results => { ]).then(results => {
if (results.reduce((a, r) => r.status === "rejected" ? ++a : a, 0)) if (results.reduce((a, r) => r.status === "rejected" ? ++a : a, 0))