mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-25 14:00:17 +00:00
Increase REST service timeout setting to 2xSECONDS_PER_SLOT. (#2627)
Fix `ansi_c` warning on Windows.
This commit is contained in:
parent
28a5bca71a
commit
84f3b2dd09
@ -11,7 +11,6 @@ import
|
|||||||
# Standard library
|
# Standard library
|
||||||
std/[math, os, osproc, random, sequtils, strformat, strutils,
|
std/[math, os, osproc, random, sequtils, strformat, strutils,
|
||||||
tables, times, terminal],
|
tables, times, terminal],
|
||||||
system/ansi_c,
|
|
||||||
|
|
||||||
# Nimble packages
|
# Nimble packages
|
||||||
stew/[objects, byteutils, endians2, io2], stew/shims/macros,
|
stew/[objects, byteutils, endians2, io2], stew/shims/macros,
|
||||||
@ -50,6 +49,9 @@ import
|
|||||||
|
|
||||||
from eth/common/eth_types import BlockHashOrNumber
|
from eth/common/eth_types import BlockHashOrNumber
|
||||||
|
|
||||||
|
when defined(posix):
|
||||||
|
import system/ansi_c
|
||||||
|
|
||||||
from
|
from
|
||||||
libp2p/protocols/pubsub/gossipsub
|
libp2p/protocols/pubsub/gossipsub
|
||||||
import
|
import
|
||||||
@ -68,7 +70,11 @@ template init(T: type RestServerRef, ip: ValidIpAddress, port: Port): T =
|
|||||||
let address = initTAddress(ip, port)
|
let address = initTAddress(ip, port)
|
||||||
let serverFlags = {HttpServerFlags.QueryCommaSeparatedArray,
|
let serverFlags = {HttpServerFlags.QueryCommaSeparatedArray,
|
||||||
HttpServerFlags.NotifyDisconnect}
|
HttpServerFlags.NotifyDisconnect}
|
||||||
let res = RestServerRef.new(getRouter(), address, serverFlags = serverFlags)
|
# We increase default timeout to help validator clients who poll our server
|
||||||
|
# at least once per slot (12.seconds).
|
||||||
|
let headersTimeout = seconds(2'i64 * int64(SECONDS_PER_SLOT))
|
||||||
|
let res = RestServerRef.new(getRouter(), address, serverFlags = serverFlags,
|
||||||
|
httpHeadersTimeout = headersTimeout)
|
||||||
if res.isErr():
|
if res.isErr():
|
||||||
notice "Rest server could not be started", address = $address,
|
notice "Rest server could not be started", address = $address,
|
||||||
reason = res.error()
|
reason = res.error()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user