缓解io压力
This commit is contained in:
@@ -169,7 +169,9 @@ type GatewayConfig struct {
|
||||
type WorkerConfig struct {
|
||||
Role string `mapstructure:"role"` // Worker 运行角色:all、leader、consumer
|
||||
InstanceName string `mapstructure:"instance_name"` // Worker 实例名称,用于多实例日志区分
|
||||
PollingTotalMaxConcurrency int `mapstructure:"polling_total_max_concurrency"` // 全部轮询总并发上限
|
||||
AuditRetentionCleanupEnabled bool `mapstructure:"audit_retention_cleanup_enabled"` // 是否启用审计日志物理清理
|
||||
AuditArchiveTasksEnabled bool `mapstructure:"audit_archive_tasks_enabled"` // 是否启用审计归档与日留存任务
|
||||
}
|
||||
|
||||
// ApprovalConfig 审批新旧入口切换配置。
|
||||
@@ -382,6 +384,10 @@ func (c *Config) Validate() error {
|
||||
constants.WorkerRoleLeader: true,
|
||||
constants.WorkerRoleConsumer: true,
|
||||
}
|
||||
if c.Worker.PollingTotalMaxConcurrency < 1 || c.Worker.PollingTotalMaxConcurrency > constants.PollingMaxConcurrencyLimit {
|
||||
return fmt.Errorf("invalid configuration: worker.polling_total_max_concurrency: must be 1-%d (current value: %d)", constants.PollingMaxConcurrencyLimit, c.Worker.PollingTotalMaxConcurrency)
|
||||
}
|
||||
|
||||
if !validWorkerRoles[c.Worker.Role] {
|
||||
return fmt.Errorf(
|
||||
"invalid configuration: worker.role: invalid worker role (current value: %s, expected: %s, %s, %s)",
|
||||
|
||||
Reference in New Issue
Block a user