mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
swarm/storage: EOF is not an error
This commit is contained in:
parent
2ead337b48
commit
7785f29b6b
2 changed files with 8 additions and 2 deletions
|
|
@ -40,6 +40,12 @@ func cliUploadAndSync(c *cli.Context) error {
|
||||||
|
|
||||||
log.Info("uploaded successfully", "hash", hash, "digest", fmt.Sprintf("%x", fhash))
|
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{}
|
wg := sync.WaitGroup{}
|
||||||
for _, endpoint := range endpoints {
|
for _, endpoint := range endpoints {
|
||||||
endpoint := endpoint
|
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
|
// 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 {
|
func fetch(hash string, endpoint string, original []byte, ruid string) error {
|
||||||
log.Trace("sleeping", "ruid", ruid)
|
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)
|
log.Trace("http get request", "ruid", ruid, "api", endpoint, "hash", hash)
|
||||||
res, err := http.Get(endpoint + "/bzz:/" + hash + "/")
|
res, err := http.Get(endpoint + "/bzz:/" + hash + "/")
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
func (self *LazyChunkReader) Read(b []byte) (read int, err error) {
|
||||||
log.Debug("lazychunkreader.read", "key", self.key)
|
log.Debug("lazychunkreader.read", "key", self.key)
|
||||||
read, err = self.ReadAt(b, self.off)
|
read, err = self.ReadAt(b, self.off)
|
||||||
if err != nil {
|
if err != nil && err != io.EOF {
|
||||||
log.Error("lazychunkreader.readat", "read", read, "err", err)
|
log.Error("lazychunkreader.readat", "read", read, "err", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue