+// RunPullWorker receives PullRequests from pullq, invokes
+// PullItemAndProcess on each one. After each PR, it logs a message
+// indicating whether the pull was successful.
+func RunPullWorker(pullq *WorkQueue, keepClient *keepclient.KeepClient) {
+ for item := range pullq.NextItem {
+ pr := item.(PullRequest)
+ err := PullItemAndProcess(pr, keepClient)
+ pullq.DoneItem <- struct{}{}
+ if err == nil {
+ log.Printf("Pull %s success", pr)
+ } else {
+ log.Printf("Pull %s error: %s", pr, err)
+ }