Skip to content

Commit

Permalink
Merge pull request #134 from fioprotocol/casey/nodetimeissue-051721
Browse files Browse the repository at this point in the history
Scope migration iteration into smaller sets for more optimized indexing.
  • Loading branch information
0xCasey authored May 18, 2021
2 parents d51dcb4 + 58bd48f commit ba81963
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions contracts/fio.request.obt/fio.request.obt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ namespace fioio {
auto trxTable = fioTransactionsTable.find(migrTable->currentobt);
if (count != limit) {
while (trxTable != fioTransactionsTable.end()) { //obt record migrate
uint64_t id = trxTable->id;
if(trxTable->fio_data_type == 4 && trxTable->obt_time == 0) {
uint64_t id = trxTable->id;
uint64_t time = trxTable->req_time;
string content = trxTable->req_content;
if( content == "" ) { content = trxTable->obt_content; }
Expand All @@ -98,13 +98,15 @@ namespace fioio {
strt.req_content = "";
strt.req_time = 0;
});
}
count++;

if (count == limit) {
mgrStatsTable.modify(migrTable, _self, [&](struct migrledger &strc) {
strc.currentobt = id + 1;
});
count++;
return;
}
if (count == limit) { return; }
trxTable++;
}
}
Expand All @@ -125,11 +127,6 @@ namespace fioio {
fr.obt_time = timestamp;
if (statTable->metadata != "") { fr.obt_content = statTable->metadata; }
});

mgrStatsTable.modify(migrTable, _self, [&](struct migrledger &strc) {
strc.currentsta = statTable->id + 1;
});

count++;
}
statTable++;
Expand All @@ -141,7 +138,12 @@ namespace fioio {
print(" ALL RECORDS HAVE BEEN COPIED ");
return;
}
if (count == limit) { return; }
if (count == limit) {
mgrStatsTable.modify(migrTable, _self, [&](struct migrledger &strc) {
strc.currentsta = statTable->id;
});
return;
}
}
}
}
Expand Down

0 comments on commit ba81963

Please sign in to comment.