mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer: linearize timeout for large chunk of data
This commit is contained in:
parent
aac4cb1f0c
commit
c127da1219
|
@ -54,7 +54,8 @@ func (c *Conn) Read(b []byte) (count int, e error) {
|
|||
|
||||
func (c *Conn) Write(b []byte) (count int, e error) {
|
||||
if c.WriteTimeout != 0 {
|
||||
err := c.Conn.SetWriteDeadline(time.Now().Add(c.WriteTimeout))
|
||||
// minimum 4KB/s
|
||||
err := c.Conn.SetWriteDeadline(time.Now().Add(c.WriteTimeout * time.Duration(len(b)/40000+1)))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue