[ARVADOS] updated: eced957ae35db978aeb4c8602d0ea30902aaa9e4

git at public.curoverse.com git at public.curoverse.com
Tue Mar 3 13:12:57 EST 2015


Summary of changes:
 services/keepstore/keepstore.go        | 2 +-
 services/keepstore/pull_worker.go      | 3 ++-
 services/keepstore/pull_worker_test.go | 6 +++---
 3 files changed, 6 insertions(+), 5 deletions(-)

       via  eced957ae35db978aeb4c8602d0ea30902aaa9e4 (commit)
      from  ca7460bcc97a8b1402b81ecebc3f0ac3131230c0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit eced957ae35db978aeb4c8602d0ea30902aaa9e4
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Tue Mar 3 12:57:31 2015 -0500

    3761: Pass pullq to RunPullWorker

diff --git a/services/keepstore/keepstore.go b/services/keepstore/keepstore.go
index ca79667..1e8c3d1 100644
--- a/services/keepstore/keepstore.go
+++ b/services/keepstore/keepstore.go
@@ -288,7 +288,7 @@ func main() {
 	}
 
 	pullq = NewWorkQueue()
-	go RunPullWorker(pullq.NextItem, keepClient)
+	go RunPullWorker(pullq, keepClient)
 
 	// Shut down the server gracefully (by closing the listener)
 	// if SIGTERM is received.
diff --git a/services/keepstore/pull_worker.go b/services/keepstore/pull_worker.go
index dced531..db1d756 100644
--- a/services/keepstore/pull_worker.go
+++ b/services/keepstore/pull_worker.go
@@ -22,7 +22,8 @@ var keepClient keepclient.KeepClient
 			Skip the rest of the servers if no errors
 		Repeat
 */
-func RunPullWorker(nextItem <-chan interface{}, kc keepclient.KeepClient) {
+func RunPullWorker(pullq *WorkQueue, kc keepclient.KeepClient) {
+	nextItem := pullq.NextItem
 	keepClient = kc
 	for item := range nextItem {
 		Pull(item.(PullRequest))
diff --git a/services/keepstore/pull_worker_test.go b/services/keepstore/pull_worker_test.go
index 84e951c..962f2b1 100644
--- a/services/keepstore/pull_worker_test.go
+++ b/services/keepstore/pull_worker_test.go
@@ -33,7 +33,7 @@ func (s *PullWorkerTestSuite) SetUpSuite(c *C) {
 	c.Assert(err, Equals, nil)
 	keepClient, err := keepclient.MakeKeepClient(&arv)
 	c.Assert(err, Equals, nil)
-	go RunPullWorker(pullq.NextItem, keepClient)
+	go RunPullWorker(pullq, keepClient)
 
 	// When a new pull request arrives, the old one will be overwritten.
 	// This behavior is simulated with delay tests below.
@@ -42,7 +42,7 @@ func (s *PullWorkerTestSuite) SetUpSuite(c *C) {
 }
 
 func (s *PullWorkerTestSuite) TearDownSuite(c *C) {
-	// give the channel enough time to read and process all pull list entries
+	// give the channel some time to read and process all pull list entries
 	time.Sleep(1000 * time.Millisecond)
 
 	expectWorkerChannelEmpty(c, pullq.NextItem)
@@ -232,7 +232,7 @@ func performTest(testData PullWorkerTestData, c *C) {
 	// We need to make sure the tests have a slight delay so that we can verify the pull list channel overwrites.
 	time.Sleep(25 * time.Millisecond)
 
-	// Override GetContent to mock keepclient functionality
+	// Override GetContent to mock keepclient Get functionality
 	GetContent = func(locator string, signedLocator string) (reader io.ReadCloser, contentLength int64, url string, err error) {
 		if strings.HasPrefix(testData.name, "TestPullWorker_pull_list_with_one_locator_with_delay") {
 			time.Sleep(100 * time.Millisecond)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list