update request to send only after given vectorClock

This commit is contained in:
Sai Raj 2019-10-16 19:37:04 +05:30 committed by GitHub
parent 6373143908
commit d44432f698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5353,11 +5353,11 @@
try {
request = request.split(" ");
if (floGlobals.storageList.includes(request[1]))
compactIDB.searchData(request[1], (k, v) => { return (v.receiverID == request[2]) })
compactIDB.searchData(request[1], (k, v) => { return (k > request[3] && v.application == request[1] && v.receiverID == request[2]) })
.then(result => floSupernode.supernodeClientWS.send(`${request[0]} ${JSON.stringify(result)}`))
.catch(error => console.log(error))
else
compactIDB.searchData(floGlobals.defaultStorage, (k, v) => { return (v.application == request[1] && v.receiverID == request[2]) })
compactIDB.searchData(floGlobals.defaultStorage, (k, v) => { return (k > request[3] && v.application == request[1] && v.receiverID == request[2]) })
.then(result => floSupernode.supernodeClientWS.send(`${request[0]} ${JSON.stringify(result)}`))
.catch(error => console.log(error))