Skip to content

Commit

Permalink
fixed elasticsearch slicer recursion algorithm resolves terascope#591
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnoble committed Oct 24, 2017
1 parent daa1177 commit 5ea16d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/readers/elasticsearch_date_range/slicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function newSlicer(context, opConfig, job, retryData, logger, client) {
}
else {
var secondDiff = Math.floor(diff / 1000);
return secondDiff > 1 ? secondDiff : 1
return secondDiff;
}
}

Expand Down Expand Up @@ -216,8 +216,8 @@ function newSlicer(context, opConfig, job, retryData, logger, client) {
var newEnd = moment(dateParams.start).add(diff, time_resolution);

//prevent recursive call if difference is one millisecond
if (diff <= 1) {
return {start: dateParams.start, end: newEnd, count: count};
if (diff <= 0) {
return {start: dateParams.start, end: dateParams.end, count: count};
}
else {
//recurse to find smaller chunk
Expand Down

0 comments on commit 5ea16d1

Please sign in to comment.