Skip to content

Commit

Permalink
0004286: batchError incorrectly checks create time
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Mar 11, 2020
1 parent 4444688 commit 7fd26dd
Showing 1 changed file with 4 additions and 10 deletions.
Expand Up @@ -60,21 +60,15 @@ public MonitorEvent check(Monitor monitor) {

OutgoingBatches outgoingBatches = outgoingBatchService.getOutgoingBatchErrors(1000);
for (OutgoingBatch batch : outgoingBatches.getBatches()) {
int batchErrorMinutes = (int) (System.currentTimeMillis() - batch.getCreateTime().getTime()) / 60000;
if (batchErrorMinutes >= monitor.getThreshold()) {
outgoingErrorCount++;
outgoingErrors.add(batch);
}
outgoingErrorCount++;
outgoingErrors.add(batch);
}

int incomingErrorCount = 0;
List<IncomingBatch> incomingBatches = incomingBatchService.findIncomingBatchErrors(1000);
for (IncomingBatch batch : incomingBatches) {
int batchErrorMinutes = (int) (System.currentTimeMillis() - batch.getCreateTime().getTime()) / 60000;
if (batchErrorMinutes >= monitor.getThreshold()) {
incomingErrorCount++;
incomingErrors.add(batch);
}
incomingErrorCount++;
incomingErrors.add(batch);
}

event.setValue(outgoingErrorCount + incomingErrorCount);
Expand Down

0 comments on commit 7fd26dd

Please sign in to comment.