mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-09-02 14:41:45 +00:00
chore: set default value of retry_interval to 1
the prior default value 0 would make hysteria retry very fast (2000 times / sec) when network is not ready (no default route). user can still set it to 0 explicitly for a "flood retry" mode.
This commit is contained in:
@@ -152,11 +152,15 @@ func client(config *clientConfig) {
|
||||
if err != nil {
|
||||
logrus.WithField("error", err).Error("Failed to initialize client")
|
||||
if try <= config.Retry || config.Retry < 0 {
|
||||
retryInterval := 1
|
||||
if config.RetryInterval != nil {
|
||||
retryInterval = *config.RetryInterval
|
||||
}
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"retry": try,
|
||||
"interval": config.RetryInterval,
|
||||
"interval": retryInterval,
|
||||
}).Info("Retrying...")
|
||||
time.Sleep(time.Duration(config.RetryInterval) * time.Second)
|
||||
time.Sleep(time.Duration(retryInterval) * time.Second)
|
||||
} else {
|
||||
logrus.Fatal("Out of retries, exiting...")
|
||||
}
|
||||
|
Reference in New Issue
Block a user