X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/04a40b8028387c4b8899d6b5b0a55d349ddab04b..61a8873440a505d1483a04354b8d1f2089e76e39:/services/keepstore/pull_worker.go diff --git a/services/keepstore/pull_worker.go b/services/keepstore/pull_worker.go index 9f0b96fa35..3c6278d478 100644 --- a/services/keepstore/pull_worker.go +++ b/services/keepstore/pull_worker.go @@ -1,14 +1,15 @@ package main import ( + "context" "crypto/rand" - "errors" "fmt" "git.curoverse.com/arvados.git/sdk/go/keepclient" "io" "io/ioutil" - "log" "time" + + log "github.com/Sirupsen/logrus" ) // RunPullWorker is used by Keepstore to initiate pull worker channel goroutine. @@ -57,7 +58,7 @@ func PullItemAndProcess(pullRequest PullRequest, token string, keepClient *keepc return } if reader == nil { - return errors.New(fmt.Sprintf("No reader found for : %s", signedLocator)) + return fmt.Errorf("No reader found for : %s", signedLocator) } defer reader.Close() @@ -67,7 +68,7 @@ func PullItemAndProcess(pullRequest PullRequest, token string, keepClient *keepc } if (readContent == nil) || (int64(len(readContent)) != contentLen) { - return errors.New(fmt.Sprintf("Content not found for: %s", signedLocator)) + return fmt.Errorf("Content not found for: %s", signedLocator) } err = PutContent(readContent, pullRequest.Locator) @@ -95,6 +96,6 @@ func GenerateRandomAPIToken() string { // Put block var PutContent = func(content []byte, locator string) (err error) { - err = PutBlock(content, locator) + _, err = PutBlock(context.Background(), content, locator) return }