execution service: Don't try to send empty bulk requests

Closes elastic/elasticsearch#264

Original commit: elastic/x-pack-elasticsearch@f636bfd956
This commit is contained in:
Martijn van Groningen 2015-04-29 11:49:17 +02:00
parent e438c51555
commit 5bc491d359
1 changed files with 8 additions and 0 deletions

View File

@ -125,6 +125,10 @@ public class ExecutionService extends AbstractComponent {
}
logger.debug("saving watch records [{}]", records.size());
if (records.size() == 0) {
return;
}
if (records.size() == 1) {
final WatchRecord watchRecord = records.getFirst();
final TriggeredExecutionContext ctx = contexts.getFirst();
@ -186,6 +190,10 @@ public class ExecutionService extends AbstractComponent {
}
logger.debug("saving watch records [{}]", records.size());
if (records.size() == 0) {
return;
}
if (records.size() == 1) {
final WatchRecord watchRecord = records.getFirst();
final TriggeredExecutionContext ctx = contexts.getFirst();