mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-31 23:41:22 +00:00
14 lines
344 B
Go
14 lines
344 B
Go
|
package sync
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/libp2p/go-libp2p-core/network"
|
||
|
"github.com/prysmaticlabs/prysm/shared/roughtime"
|
||
|
)
|
||
|
|
||
|
func setRPCStreamDeadlines(stream network.Stream) {
|
||
|
stream.SetReadDeadline(roughtime.Now().Add(5 * time.Second)) // TTFB_TIMEOUT
|
||
|
stream.SetWriteDeadline(roughtime.Now().Add(10 * time.Second)) // RESP_TIMEOUT
|
||
|
}
|