Fixed minor bugs
- Fixed: Infinite sync loop occurring in receiver end - Fixed: clearUnauthorisedAppData SQL statement
This commit is contained in:
parent
49dce2b8b6
commit
5bca07d2d6
@ -80,6 +80,7 @@ const queueSync = {
|
|||||||
console.warn(`Queue-Sync: queue list is empty, but hash list is not empty for ${node_i}`);
|
console.warn(`Queue-Sync: queue list is empty, but hash list is not empty for ${node_i}`);
|
||||||
//all blocks synced, remove the sync instance
|
//all blocks synced, remove the sync instance
|
||||||
console.info(`END: Data sync for ${node_i}`);
|
console.info(`END: Data sync for ${node_i}`);
|
||||||
|
clearInterval(r.check_interval);
|
||||||
delete this.list[node_i];
|
delete this.list[node_i];
|
||||||
//indicate next node for ordering
|
//indicate next node for ordering
|
||||||
_nextNode.send(packet_.construct({
|
_nextNode.send(packet_.construct({
|
||||||
|
|||||||
@ -476,12 +476,11 @@ DB.clearAuthorisedAppData = function (snID, app, adminID, subAdmins, timestamp)
|
|||||||
|
|
||||||
DB.clearUnauthorisedAppData = function (snID, appList, timestamp) {
|
DB.clearUnauthorisedAppData = function (snID, appList, timestamp) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let statement = "SELECT * FROM _" + snID +
|
let statement = "DELETE FROM _" + snID +
|
||||||
" WHERE " + H_struct.TIME + "<?" +
|
" WHERE " + H_struct.TIME + "<?" +
|
||||||
(appList.length ? " AND " +
|
(appList.length ? " AND " +
|
||||||
H_struct.APPLICATION + " NOT IN (" + appList.map(a => "?").join(", ") + ")" :
|
H_struct.APPLICATION + " NOT IN (" + appList.map(a => "?").join(", ") + ")" :
|
||||||
"");
|
"");
|
||||||
console.debug(statement, [timestamp].concat(appList))
|
|
||||||
queryResolve(statement, [timestamp].concat(appList))
|
queryResolve(statement, [timestamp].concat(appList))
|
||||||
.then(result => resolve(result))
|
.then(result => resolve(result))
|
||||||
.catch(error => reject(error));
|
.catch(error => reject(error));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user