feat: support sync mode for http response. (#208)
* feat: support sync mode for http response. * fix: update readme. * fix: check wg exist. * fix: testing sync mode.
This commit is contained in:
@@ -24,6 +24,7 @@ type SectionCore struct {
|
||||
WorkerNum int64 `yaml:"worker_num"`
|
||||
QueueNum int64 `yaml:"queue_num"`
|
||||
Mode string `yaml:"mode"`
|
||||
Sync bool `yaml:"sync"`
|
||||
SSL bool `yaml:"ssl"`
|
||||
CertPath string `yaml:"cert_path"`
|
||||
KeyPath string `yaml:"key_path"`
|
||||
@@ -123,6 +124,7 @@ func BuildDefaultPushConf() ConfYaml {
|
||||
conf.Core.WorkerNum = int64(runtime.NumCPU())
|
||||
conf.Core.QueueNum = int64(8192)
|
||||
conf.Core.Mode = "release"
|
||||
conf.Core.Sync = false
|
||||
conf.Core.SSL = false
|
||||
conf.Core.CertPath = "cert.pem"
|
||||
conf.Core.KeyPath = "key.pem"
|
||||
|
||||
@@ -3,6 +3,7 @@ core:
|
||||
worker_num: 0 # default worker number is runtime.NumCPU()
|
||||
queue_num: 0 # default queue number is 8192
|
||||
max_notification: 100
|
||||
sync: false # set true if you get http response after finish send notification.
|
||||
mode: "release"
|
||||
ssl: false
|
||||
cert_path: "cert.pem"
|
||||
|
||||
@@ -59,6 +59,7 @@ func (suite *ConfigTestSuite) TestValidateConfDefault() {
|
||||
assert.Equal(suite.T(), int64(runtime.NumCPU()), suite.ConfGorushDefault.Core.WorkerNum)
|
||||
assert.Equal(suite.T(), int64(8192), suite.ConfGorushDefault.Core.QueueNum)
|
||||
assert.Equal(suite.T(), "release", suite.ConfGorushDefault.Core.Mode)
|
||||
assert.Equal(suite.T(), false, suite.ConfGorushDefault.Core.Sync)
|
||||
assert.Equal(suite.T(), false, suite.ConfGorushDefault.Core.SSL)
|
||||
assert.Equal(suite.T(), "cert.pem", suite.ConfGorushDefault.Core.CertPath)
|
||||
assert.Equal(suite.T(), "key.pem", suite.ConfGorushDefault.Core.KeyPath)
|
||||
@@ -118,6 +119,7 @@ func (suite *ConfigTestSuite) TestValidateConf() {
|
||||
assert.Equal(suite.T(), int64(runtime.NumCPU()), suite.ConfGorush.Core.WorkerNum)
|
||||
assert.Equal(suite.T(), int64(8192), suite.ConfGorush.Core.QueueNum)
|
||||
assert.Equal(suite.T(), "release", suite.ConfGorush.Core.Mode)
|
||||
assert.Equal(suite.T(), false, suite.ConfGorush.Core.Sync)
|
||||
assert.Equal(suite.T(), false, suite.ConfGorush.Core.SSL)
|
||||
assert.Equal(suite.T(), "cert.pem", suite.ConfGorush.Core.CertPath)
|
||||
assert.Equal(suite.T(), "key.pem", suite.ConfGorush.Core.KeyPath)
|
||||
|
||||
Reference in New Issue
Block a user