mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Reduce client connection attempts to test engine status (tests)
200 -> 16 Previously, considering the fibonacci back off strategy, if engine failed to start it would have tried to attempt connections for 2.862799e+33 years. Now, the amount of attempts is 16, equivalent to around 2 and a half seconds. Should be more than enough, considering that usually 6-7 attempts are enough.
This commit is contained in:
committed by
Dan Christian Bogos
parent
7e663e7b60
commit
4daeb35609
@@ -345,7 +345,7 @@ func StartEngine(cfgPath string, waitEngine int) (*exec.Cmd, error) {
|
||||
}
|
||||
fib := utils.Fib()
|
||||
var connected bool
|
||||
for i := 0; i < 200; i++ {
|
||||
for i := 0; i < 16; i++ {
|
||||
time.Sleep(time.Duration(fib()) * time.Millisecond)
|
||||
if _, err := jsonrpc.Dial(utils.TCP, cfg.ListenCfg().RPCJSONListen); err != nil {
|
||||
utils.Logger.Warning(fmt.Sprintf("Error <%s> when opening test connection to: <%s>",
|
||||
|
||||
Reference in New Issue
Block a user