swarm/storage: EOF is not an error

This commit is contained in:
Anton Evangelatov 2018-04-22 16:08:57 +02:00
parent 2ead337b48
commit 7785f29b6b
2 changed files with 8 additions and 2 deletions

View file

@ -40,6 +40,12 @@ func cliUploadAndSync(c *cli.Context) error {
log.Info("uploaded successfully", "hash", hash, "digest", fmt.Sprintf("%x", fhash))
if filesize < 10 {
time.Sleep(15 * time.Second)
} else {
time.Sleep(2 * time.Duration(filesize) * time.Second)
}
wg := sync.WaitGroup{}
for _, endpoint := range endpoints {
endpoint := endpoint
@ -66,7 +72,7 @@ func cliUploadAndSync(c *cli.Context) error {
// fetch is getting the requested `hash` from the `endpoint` and compares it with the `original` file
func fetch(hash string, endpoint string, original []byte, ruid string) error {
log.Trace("sleeping", "ruid", ruid)
time.Sleep(10 * time.Second)
time.Sleep(1 * time.Second)
log.Trace("http get request", "ruid", ruid, "api", endpoint, "hash", hash)
res, err := http.Get(endpoint + "/bzz:/" + hash + "/")

View file

@ -538,7 +538,7 @@ func (self *LazyChunkReader) join(b []byte, off int64, eoff int64, depth int, tr
func (self *LazyChunkReader) Read(b []byte) (read int, err error) {
log.Debug("lazychunkreader.read", "key", self.key)
read, err = self.ReadAt(b, self.off)
if err != nil {
if err != nil && err != io.EOF {
log.Error("lazychunkreader.readat", "read", read, "err", err)
}