chore(gorush): add timeout for http client (#473)
* chore(gorush): add timeout for http client dispatch feedback url See: https://github.com/appleboy/gorush/issues/449 * docs: update readme
This commit is contained in:
@@ -21,6 +21,7 @@ core:
|
||||
max_notification: 100
|
||||
sync: false # set true if you need get error message from fail push notification in API response.
|
||||
feedback_hook_url: "" # set webhook url if you need get error message asynchronously from fail push notification in API response.
|
||||
feedback_timeout: 10 # default is 10 second
|
||||
mode: "release"
|
||||
ssl: false
|
||||
cert_path: "cert.pem"
|
||||
@@ -118,6 +119,7 @@ type SectionCore struct {
|
||||
KeyBase64 string `yaml:"key_base64"`
|
||||
HTTPProxy string `yaml:"http_proxy"`
|
||||
FeedbackURL string `yaml:"feedback_hook_url"`
|
||||
FeedbackTimeout int64 `yaml:"feedback_timeout"`
|
||||
PID SectionPID `yaml:"pid"`
|
||||
AutoTLS SectionAutoTLS `yaml:"auto_tls"`
|
||||
}
|
||||
@@ -262,6 +264,7 @@ func LoadConf(confPath string) (ConfYaml, error) {
|
||||
conf.Core.Mode = viper.GetString("core.mode")
|
||||
conf.Core.Sync = viper.GetBool("core.sync")
|
||||
conf.Core.FeedbackURL = viper.GetString("core.feedback_hook_url")
|
||||
conf.Core.FeedbackTimeout = int64(viper.GetInt("core.feedback_timeout"))
|
||||
conf.Core.SSL = viper.GetBool("core.ssl")
|
||||
conf.Core.CertPath = viper.GetString("core.cert_path")
|
||||
conf.Core.KeyPath = viper.GetString("core.key_path")
|
||||
|
||||
Reference in New Issue
Block a user