Skip to content

Commit

Permalink
removes logs and fixes if statement ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley14 committed Jul 16, 2020
1 parent 0be924c commit daf8bbb
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,19 @@ export const searchAfterAndBulkCreate = async ({
logger.debug(
buildRuleMessage(`filteredEvents.hits.hits: ${filteredEvents.hits.hits.length}`)
);

if (
filteredEvents.hits.hits[0].sort == null ||
filteredEvents.hits.hits[0].sort.length === 0
) {
logger.debug('\n\n\nBREAKING HERE 3\n\n\n');
logger.debug(buildRuleMessage('sortIds was empty on filter'));
toReturn.success = true;
break;
} else if (
filteredEvents.hits.hits !== null &&
filteredEvents.hits.hits[0].sort !== null
filteredEvents.hits.hits != null &&
filteredEvents.hits.hits[0].sort != null &&
filteredEvents.hits.hits[0].sort.length !== 0
) {
logger.debug('SETTING SORT ID HERE');
sortId = filteredEvents.hits.hits[0].sort
? filteredEvents.hits.hits[0].sort[0]
: undefined;
} else {
logger.debug(buildRuleMessage('sortIds was empty on search'));
toReturn.success = true;
break;
}
} else {
// we are guaranteed to have searchResult hits at this point
Expand Down

0 comments on commit daf8bbb

Please sign in to comment.