added name to batch loop so break works properly (#1650)

This commit is contained in:
Corey 2019-11-06 09:12:05 -05:00 committed by GitHub
parent a4a7ae21b5
commit 457acec72e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -712,6 +712,7 @@ func (s *WMailServer) processRequestInBundles(
"cursor", nextCursor) "cursor", nextCursor)
// Publish // Publish
batchLoop:
for _, batch := range batches { for _, batch := range batches {
select { select {
case output <- batch: case output <- batch:
@ -722,11 +723,11 @@ func (s *WMailServer) processRequestInBundles(
case <-cancel: case <-cancel:
log.Info("[mailserver:processRequestInBundles] failed to push all batches", log.Info("[mailserver:processRequestInBundles] failed to push all batches",
"requestID", requestID) "requestID", requestID)
break break batchLoop
case <-time.After(timeout): case <-time.After(timeout):
log.Error("[mailserver:processRequestInBundles] timed out pushing a batch", log.Error("[mailserver:processRequestInBundles] timed out pushing a batch",
"requestID", requestID) "requestID", requestID)
break break batchLoop
} }
} }