projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
10816: Add comments to poorly-documented name/binds args to exec_query().
[arvados.git]
/
services
/
keepstore
/
pull_worker.go
diff --git
a/services/keepstore/pull_worker.go
b/services/keepstore/pull_worker.go
index 2626d4bf68e1594f394ad4539f0f32a90fe00339..3c6278d478d3d897982b2b6f8c9a166c505e6433 100644
(file)
--- a/
services/keepstore/pull_worker.go
+++ b/
services/keepstore/pull_worker.go
@@
-1,14
+1,15
@@
package main
import (
package main
import (
+ "context"
"crypto/rand"
"crypto/rand"
- "errors"
"fmt"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
"io"
"io/ioutil"
"fmt"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
"io"
"io/ioutil"
- "log"
"time"
"time"
+
+ log "github.com/Sirupsen/logrus"
)
// RunPullWorker is used by Keepstore to initiate pull worker channel goroutine.
)
// 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
}
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()
}
defer reader.Close()
@@
-67,7
+68,7
@@
func PullItemAndProcess(pullRequest PullRequest, token string, keepClient *keepc
}
if (readContent == nil) || (int64(len(readContent)) != contentLen) {
}
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)
}
err = PutContent(readContent, pullRequest.Locator)
@@
-95,6
+96,6
@@
func GenerateRandomAPIToken() string {
// Put block
var PutContent = func(content []byte, locator string) (err error) {
// Put block
var PutContent = func(content []byte, locator string) (err error) {
- _, err = PutBlock(content, locator)
+ _, err = PutBlock(conte
xt.Background(), conte
nt, locator)
return
}
return
}