mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
add retry configs
This commit is contained in:
@@ -24,6 +24,8 @@ func NewCoordinatorClient(cfg *config.CoordinatorConfig) (*CoordinatorClient, er
|
||||
|
||||
client := resty.New().
|
||||
SetTimeout(time.Duration(cfg.Timeout) * time.Second).
|
||||
SetRetryCount(cfg.RetryCount).
|
||||
SetRetryWaitTime(time.Duration(cfg.RetryWaitTime) * time.Second).
|
||||
SetBaseURL(cfg.BaseURL)
|
||||
|
||||
return &CoordinatorClient{
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
},
|
||||
"coordinator": {
|
||||
"base_url": "https://coordinator/v1",
|
||||
"timeout": 30
|
||||
"timeout": 30,
|
||||
"retry_count": 3,
|
||||
"retry_wait_time": 10
|
||||
},
|
||||
"confirmations": "0x1"
|
||||
}
|
||||
|
||||
@@ -33,8 +33,10 @@ type ProverCoreConfig struct {
|
||||
|
||||
// CoordinatorConfig represents the configuration for the Coordinator client.
|
||||
type CoordinatorConfig struct {
|
||||
Timeout int `json:"timeout"`
|
||||
BaseURL string `json:"base_url"`
|
||||
Timeout int `json:"timeout"`
|
||||
BaseURL string `json:"base_url"`
|
||||
RetryCount int `json:"retry_count"`
|
||||
RetryWaitTime int `json:"retry_wait_time"`
|
||||
}
|
||||
|
||||
// NewConfig returns a new instance of Config.
|
||||
|
||||
Reference in New Issue
Block a user