Permalink
Browse files

Don't hang on error transmit on canceled pathgen

  • Loading branch information...
dustin committed Jun 30, 2013
1 parent 93c6375 commit 32526069c4e692334e1d882bd9a88ae6881757ba
Showing with 5 additions and 3 deletions.
  1. +5 −3 pathgen.go
View
@@ -73,7 +73,10 @@ func pathGenerator(from string, ch chan *namedFile,
}, &viewRes)
if err != nil {
log.Printf("View error: %v", err)
- errs <- err
+ select {
+ case errs <- err:
+ case <-quit:
+ }
return
}
for _, e := range viewRes.Errors {
@@ -89,8 +92,7 @@ func pathGenerator(from string, ch chan *namedFile,
for _, r := range viewRes.Rows {
k := strings.Join(r.Key, "/")
if !strings.HasPrefix(k, from) {
- done = true
- break
+ return
}
startKey = r.Key

0 comments on commit 3252606

Please sign in to comment.