Skip to content

Commit

Permalink
remove file while sync timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
sjqzhang committed Jul 1, 2019
1 parent 6f13875 commit 40849b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func NewServer() *Server {

defaultTransport := &http.Transport{
DisableKeepAlives: true,
Dial: httplib.TimeoutDialer(time.Second*6, time.Second*60),
Dial: httplib.TimeoutDialer(time.Second*6, time.Second*300),
MaxIdleConns: 100,
MaxIdleConnsPerHost: 100,
}
Expand Down Expand Up @@ -772,6 +772,7 @@ func (this *Server) DownloadFromPeer(peer string, fileInfo *FileInfo) {
return
}
if err = req.ToFile(fpath); err != nil {
os.Remove(fpath)
log.Error(err)
return
}
Expand Down

0 comments on commit 40849b1

Please sign in to comment.