send max 30 at once to NS
This commit is contained in:
parent
fa24368701
commit
98848b61ec
1 changed files with 3 additions and 1 deletions
|
@ -684,10 +684,11 @@ public class NSClientService extends Service {
|
||||||
MainApp.bus().post(new EventNSClientNewLog("QUEUE", "Resend started: " + reason));
|
MainApp.bus().post(new EventNSClientNewLog("QUEUE", "Resend started: " + reason));
|
||||||
|
|
||||||
CloseableIterator<DbRequest> iterator = null;
|
CloseableIterator<DbRequest> iterator = null;
|
||||||
|
int maxcount = 30;
|
||||||
try {
|
try {
|
||||||
iterator = MainApp.getDbHelper().getDbRequestInterator();
|
iterator = MainApp.getDbHelper().getDbRequestInterator();
|
||||||
try {
|
try {
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext() && maxcount > 0) {
|
||||||
DbRequest dbr = iterator.next();
|
DbRequest dbr = iterator.next();
|
||||||
if (dbr.action.equals("dbAdd")) {
|
if (dbr.action.equals("dbAdd")) {
|
||||||
NSAddAck addAck = new NSAddAck();
|
NSAddAck addAck = new NSAddAck();
|
||||||
|
@ -702,6 +703,7 @@ public class NSClientService extends Service {
|
||||||
NSUpdateAck updateUnsetAck = new NSUpdateAck(dbr.action, dbr._id);
|
NSUpdateAck updateUnsetAck = new NSUpdateAck(dbr.action, dbr._id);
|
||||||
dbUpdateUnset(dbr, updateUnsetAck);
|
dbUpdateUnset(dbr, updateUnsetAck);
|
||||||
}
|
}
|
||||||
|
maxcount--;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
iterator.close();
|
iterator.close();
|
||||||
|
|
Loading…
Add table
Reference in a new issue