policy_config

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package policy_config defines maintenance scheduling configuration loaded by config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentMaxWorkers

func CurrentMaxWorkers() int

CurrentMaxWorkers 返回 Policy 允许的最大异步执行数;倍率缺省或非法时按 1 计算。

func CurrentPolicyDuration

func CurrentPolicyDuration() time.Duration

CurrentPolicyDuration 用时现解 policy_duration 字符串;缺省或非法回落默认 10s 并输出字段级警告。

Types

type PolicyConfig

type PolicyConfig struct {
	// PolicyDuration 是定期轮询事项「执行完一次到下一次开始」的间隔,Go duration 字符串(如 "10s"、"1h")。
	PolicyDuration string `yaml:"policy_duration" json:"policy_duration" toml:"policy_duration"`
	// WorkersScaller 是 Policy 异步任务最大并发倍率,实际上限 = CPU 数量 × 倍率。
	WorkersScaller int `yaml:"workers_scaller" json:"workers_scaller" toml:"workers_scaller"`
}
var CurrentCfgPolicy *PolicyConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL