Browse Source

Update weed/util/net_timeout.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
pull/7626/head
Chris Lu 7 days ago
committed by GitHub
parent
commit
6d94715ff9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      weed/util/net_timeout.go

2
weed/util/net_timeout.go

@ -41,7 +41,7 @@ type Conn struct {
// extendDeadline extends the connection deadline from now. // extendDeadline extends the connection deadline from now.
// This implements "no activity timeout" - any activity keeps the connection alive. // This implements "no activity timeout" - any activity keeps the connection alive.
func (c *Conn) extendDeadline() error { func (c *Conn) extendDeadline() error {
if c.Timeout != 0 {
if c.Timeout > 0 {
return c.Conn.SetDeadline(time.Now().Add(c.Timeout)) return c.Conn.SetDeadline(time.Now().Add(c.Timeout))
} }
return nil return nil

Loading…
Cancel
Save