storagenode: Increase order sending request timeout (#2930)
This commit is contained in:
parent
10a896bf73
commit
3fbe31aada
@ -82,6 +82,7 @@ type DB interface {
|
||||
type Config struct {
|
||||
SenderInterval time.Duration `help:"duration between sending" default:"1h0m0s"`
|
||||
SenderTimeout time.Duration `help:"timeout for sending" default:"1h0m0s"`
|
||||
SenderRequestTimeout time.Duration `help:"timeout for read/write operations during sending" default:"1h0m0s"`
|
||||
CleanupInterval time.Duration `help:"duration between archive cleanups" default:"24h0m0s"`
|
||||
ArchiveTTL time.Duration `help:"length of time to archive orders before deletion" default:"168h0m0s"` // 7 days
|
||||
}
|
||||
|
@ -290,9 +290,20 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB, revocationDB exten
|
||||
}
|
||||
pb.RegisterPiecestoreServer(peer.Server.GRPC(), peer.Storage2.Endpoint)
|
||||
|
||||
sc := config.Server
|
||||
options, err := tlsopts.NewOptions(peer.Identity, sc.Config, revocationDB)
|
||||
if err != nil {
|
||||
return nil, errs.Combine(err, peer.Close())
|
||||
}
|
||||
|
||||
// TODO workaround for custom timeout for order sending request (read/write)
|
||||
ordersTransport := transport.NewClientWithTimeouts(options, transport.Timeouts{
|
||||
Request: config.Storage2.Orders.SenderRequestTimeout,
|
||||
})
|
||||
|
||||
peer.Storage2.Orders = orders.NewService(
|
||||
log.Named("orders"),
|
||||
peer.Transport,
|
||||
ordersTransport,
|
||||
peer.DB.Orders(),
|
||||
peer.Storage2.Trust,
|
||||
config.Storage2.Orders,
|
||||
|
Loading…
Reference in New Issue
Block a user