Skip to content

Commit ffcf471

Browse files
authored
Update server.go
1 parent c4ffb55 commit ffcf471

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/graceful/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ var (
3131
// PerWriteWriteTimeout timeout for writes
3232
const PerWriteWriteTimeout = 30 * time.Second
3333

34-
// PerWriteWriteTimeoutKbRate is a timeout taking account of how much there is to be written
35-
const PerWriteWriteTimeoutKbRate = 2 * time.Second
34+
// PerWriteWriteTimeoutKbTime is a timeout taking account of how much there is to be written
35+
const PerWriteWriteTimeoutKbTime = 10 * time.Second
3636

3737
func init() {
3838
DefaultMaxHeaderBytes = 0 // use http.DefaultMaxHeaderBytes - which currently is 1 << 20 (1MB)
@@ -259,7 +259,7 @@ type wrappedConn struct {
259259

260260
func (w wrappedConn) Write(p []byte) (n int, err error) {
261261
if PerWriteWriteTimeout > 0 {
262-
minTimeout := time.Duration(len(p)/1024)*PerWriteWriteTimeoutKbRate
262+
minTimeout := time.Duration(len(p)/1024) * PerWriteWriteTimeoutKbTime
263263
minDeadline := time.Now().Add(minTimeout).Add(PerWriteWriteTimeout)
264264

265265
w.deadline = w.deadline.Add(minTimeout)

0 commit comments

Comments
 (0)