Skip to content

Commit

Permalink
fix intended deadline
Browse files Browse the repository at this point in the history
  • Loading branch information
likeazir committed Aug 29, 2023
1 parent 8844870 commit d5a6a34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cache/filecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (CF *CachedFile) Read(offset, length int) ([]byte, error) {
defer peekaboo.lock.Unlock()
for i := 0; i < CF.lru.Len()/30; i++ {
go CF.ReadNewData(lruBlock + i)
time.Sleep(100 * time.Nanosecond)
time.Sleep(10 * time.Nanosecond)
}
if len(peekaboo.data) < blockOffset {
return []byte{}, nil
Expand Down
2 changes: 1 addition & 1 deletion fileretriever/fileclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func (f *FileClient) netReadDir(path RemotePath, peer string) ([]fuse.DirEntry,
return nil, err
}
defer conn.Close()
err = conn.SetDeadline(time.Now().Add(DEADLINE * time.Second))
err = conn.SetDeadline(time.Now().Add(DEADLINE))
if err != nil {
log.Warn().Err(err).Msg("Failed to set deadline")
return nil, err
Expand Down

0 comments on commit d5a6a34

Please sign in to comment.