From 282ab574e56f7cb5bcddf4d3ae3ac3a7db90611b Mon Sep 17 00:00:00 2001 From: YashK Date: Fri, 4 Oct 2024 13:14:21 +0530 Subject: [PATCH] refactor: rebased retry params with current main branch v2.0.0 release --- core/constants.go | 5 ++++- utils/struct-utils.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/constants.go b/core/constants.go index bf830a83..cb016ca7 100644 --- a/core/constants.go +++ b/core/constants.go @@ -17,7 +17,10 @@ const ( // ChainId corresponds to the EUROPA chain var ChainId = big.NewInt(0x79f99296) -const MaxRetries uint = 4 +const ( + MaxRetries uint = 3 + RetryDelayDuration int64 = 1 +) var NilHash = common.Hash{0x00} diff --git a/utils/struct-utils.go b/utils/struct-utils.go index bb0dcdb3..5b25dc2f 100644 --- a/utils/struct-utils.go +++ b/utils/struct-utils.go @@ -145,7 +145,7 @@ func InvokeFunctionWithRetryAttempts(ctx context.Context, interfaceName interfac } return nil } - }, RetryInterface.RetryAttempts(core.MaxRetries)) + }, RetryInterface.RetryAttempts(core.MaxRetries), retry.Delay(time.Second*time.Duration(core.RetryDelayDuration)), retry.DelayType(retry.FixedDelay)) if err != nil { if contextError { // Skip the alternate client switch when the error is context-related