X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/90483e26cf9f0ced8e5b12586ae3a5e1ec620add..b70f9ce54f1f672b423999e6c07b2f0127b76666:/services/keepstore/keepstore.go diff --git a/services/keepstore/keepstore.go b/services/keepstore/keepstore.go index 03eef7e76b..79e3017d55 100644 --- a/services/keepstore/keepstore.go +++ b/services/keepstore/keepstore.go @@ -8,7 +8,6 @@ import ( "flag" "fmt" "net" - "net/http" "os" "os/signal" "syscall" @@ -165,19 +164,23 @@ func main() { log.Fatal(err) } - // Initialize Pull queue and worker + // Initialize keepclient for pull workers keepClient := &keepclient.KeepClient{ Arvados: &arvadosclient.ArvadosClient{}, Want_replicas: 1, } - // Initialize the pullq and worker + // Initialize the pullq and workers pullq = NewWorkQueue() - go RunPullWorker(pullq, keepClient) + for i := 0; i < 1 || i < theConfig.PullWorkers; i++ { + go RunPullWorker(pullq, keepClient) + } - // Initialize the trashq and worker + // Initialize the trashq and workers trashq = NewWorkQueue() - go RunTrashWorker(trashq) + for i := 0; i < 1 || i < theConfig.TrashWorkers; i++ { + go RunTrashWorker(trashq) + } // Start emptyTrash goroutine doneEmptyingTrash := make(chan bool) @@ -199,7 +202,8 @@ func main() { log.Printf("Error notifying init daemon: %v", err) } log.Println("listening at", listener.Addr()) - srv := &http.Server{Handler: router} + srv := &server{} + srv.Handler = router srv.Serve(listener) }