From e4c35d22fa931c54c4ee45b4626ba8a8f55596a7 Mon Sep 17 00:00:00 2001 From: chenson42 Date: Tue, 17 Dec 2013 21:29:17 +0000 Subject: [PATCH] 0001491: Mark outgoing batches as OK during the start of an initial load can hanging until the config channel has been pulled --- .../symmetric/service/impl/OutgoingBatchService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchService.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchService.java index 7eee0426b8..44f8ef4f65 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchService.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchService.java @@ -87,7 +87,9 @@ public OutgoingBatchService(IParameterService parameterService, public void markAllAsSentForNode(String nodeId, boolean includeConfigChannel) { OutgoingBatches batches = null; + int configCount; do { + configCount = 0; batches = getOutgoingBatches(nodeId, true); List list = batches.getBatches(); /* @@ -100,14 +102,17 @@ public int compare(OutgoingBatch o1, OutgoingBatch o2) { return -new Long(o1.getBatchId()).compareTo(o2.getBatchId()); } }); - for (OutgoingBatch outgoingBatch : batches.getBatches()) { + + for (OutgoingBatch outgoingBatch : list) { if (includeConfigChannel || !outgoingBatch.getChannelId().equals(Constants.CHANNEL_CONFIG)) { outgoingBatch.setStatus(Status.OK); outgoingBatch.setErrorFlag(false); updateOutgoingBatch(outgoingBatch); + } else { + configCount++; } } - } while (batches.getBatches().size() > 0); + } while (batches.getBatches().size() > configCount); } public void updateAbandonedRoutingBatches() {