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));
|
||||
|
||||
CloseableIterator<DbRequest> iterator = null;
|
||||
int maxcount = 30;
|
||||
try {
|
||||
iterator = MainApp.getDbHelper().getDbRequestInterator();
|
||||
try {
|
||||
while (iterator.hasNext()) {
|
||||
while (iterator.hasNext() && maxcount > 0) {
|
||||
DbRequest dbr = iterator.next();
|
||||
if (dbr.action.equals("dbAdd")) {
|
||||
NSAddAck addAck = new NSAddAck();
|
||||
|
@ -702,6 +703,7 @@ public class NSClientService extends Service {
|
|||
NSUpdateAck updateUnsetAck = new NSUpdateAck(dbr.action, dbr._id);
|
||||
dbUpdateUnset(dbr, updateUnsetAck);
|
||||
}
|
||||
maxcount--;
|
||||
}
|
||||
} finally {
|
||||
iterator.close();
|
||||
|
|
Loading…
Reference in a new issue