Skip to content

Commit

Permalink
client: use bigger TTL, expose it to clients
Browse files Browse the repository at this point in the history
This value is better be known to users and it's better be more than two since
we can have more complicated communications in future.

Refs. nspcc-dev/neofs-node#2447

Signed-off-by: Roman Khimov <roman@nspcc.ru>
  • Loading branch information
roman-khimov committed Feb 28, 2024
1 parent d1bb088 commit c9e42b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const (
fieldNumSigPubKey = 1
fieldNumSigVal = 2
fieldNumSigScheme = 3

// DefaultTTL is a TTL used for NeoFS requests if no other value is
// set specifically for a call.
DefaultTTL = 8
)

// groups meta parameters shared between all Client operations.
Expand Down Expand Up @@ -120,7 +124,7 @@ func (x contextCall) prepareRequest() {
}

if meta.GetTTL() == 0 {
meta.SetTTL(2)
meta.SetTTL(DefaultTTL)
}

if meta.GetVersion() == nil {
Expand All @@ -137,7 +141,7 @@ func (x contextCall) prepareRequest() {
func (c *Client) prepareRequest(req request, meta *v2session.RequestMetaHeader) {
ttl := meta.GetTTL()
if ttl == 0 {
ttl = 2
ttl = DefaultTTL
}

verV2 := meta.GetVersion()
Expand Down

0 comments on commit c9e42b3

Please sign in to comment.