Skip to content

Commit

Permalink
Don't re-extract if a network transfer failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Apr 28, 2011
1 parent 679e360 commit e128495
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -455,14 +455,14 @@ public List<OutgoingBatch> extract(Node node, IOutgoingTransport targetTransport
fileWriter.reset();

File previouslyExtracted = extractedBatchesHandle.get(currentBatch.getBatchId());
if (previouslyExtracted == null) {
if (previouslyExtracted != null && previouslyExtracted.exists()) {
log.info("DataExtractorUsingAlreadyExtractedBatch", currentBatch.getBatchId());
fileWriter.setFile(previouslyExtracted);
} else {
outgoingBatch.setStatus(OutgoingBatch.Status.QY);
outgoingBatch.setExtractCount(outgoingBatch.getExtractCount() + 1);
outgoingBatchService.updateOutgoingBatch(outgoingBatch);
databaseExtract(node, outgoingBatch, handler);
} else {
log.info("DataExtractorUsingAlreadyExtractedBatch", currentBatch.getBatchId());
fileWriter.setFile(previouslyExtracted);
}
outgoingBatch.setStatus(OutgoingBatch.Status.SE);
outgoingBatch.setSentCount(outgoingBatch.getSentCount() + 1);
Expand Down

0 comments on commit e128495

Please sign in to comment.