mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
event durability count and cfg
This commit is contained in:
@@ -488,6 +488,10 @@ type ServerConfig struct {
|
||||
// will generate events for its event stream.
|
||||
EnableEventPublisher bool `hcl:"enable_event_publisher"`
|
||||
|
||||
// DurableEventCount specifies the amount of events to persist during snapshot generation.
|
||||
// A count of 0 signals that no events should be persisted.
|
||||
DurableEventCount int `hcl:"durable_event_count"`
|
||||
|
||||
// ExtraKeysHCL is used by hcl to surface unexpected keys
|
||||
ExtraKeysHCL []string `hcl:",unusedKeys" json:"-"`
|
||||
}
|
||||
@@ -880,6 +884,7 @@ func DefaultConfig() *Config {
|
||||
Server: &ServerConfig{
|
||||
Enabled: false,
|
||||
EnableEventPublisher: true,
|
||||
DurableEventCount: 100,
|
||||
StartJoin: []string{},
|
||||
ServerJoin: &ServerJoin{
|
||||
RetryJoin: []string{},
|
||||
@@ -1408,6 +1413,10 @@ func (a *ServerConfig) Merge(b *ServerConfig) *ServerConfig {
|
||||
result.EnableEventPublisher = true
|
||||
}
|
||||
|
||||
if b.DurableEventCount != 0 {
|
||||
result.DurableEventCount = b.DurableEventCount
|
||||
}
|
||||
|
||||
if b.DefaultSchedulerConfig != nil {
|
||||
c := *b.DefaultSchedulerConfig
|
||||
result.DefaultSchedulerConfig = &c
|
||||
|
||||
@@ -123,6 +123,7 @@ var basicConfig = &Config{
|
||||
UpgradeVersion: "0.8.0",
|
||||
EncryptKey: "abc",
|
||||
EnableEventPublisher: true,
|
||||
DurableEventCount: 100,
|
||||
ServerJoin: &ServerJoin{
|
||||
RetryJoin: []string{"1.1.1.1", "2.2.2.2"},
|
||||
RetryInterval: time.Duration(15) * time.Second,
|
||||
|
||||
1
command/agent/testdata/basic.hcl
vendored
1
command/agent/testdata/basic.hcl
vendored
@@ -131,6 +131,7 @@ server {
|
||||
encrypt = "abc"
|
||||
raft_multiplier = 4
|
||||
enable_event_publisher = true
|
||||
durable_event_count = 100
|
||||
|
||||
server_join {
|
||||
retry_join = ["1.1.1.1", "2.2.2.2"]
|
||||
|
||||
1
command/agent/testdata/basic.json
vendored
1
command/agent/testdata/basic.json
vendored
@@ -262,6 +262,7 @@
|
||||
"deployment_gc_threshold": "12h",
|
||||
"enabled": true,
|
||||
"enable_event_publisher": true,
|
||||
"durable_event_count": 100,
|
||||
"enabled_schedulers": [
|
||||
"test"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user