platform: modularize api/gui, add docs-tests-web foundation, and refresh root config
This commit is contained in:
64
selective-vpn-api/app/resolver/start_log.go
Normal file
64
selective-vpn-api/app/resolver/start_log.go
Normal file
@@ -0,0 +1,64 @@
|
||||
package resolver
|
||||
|
||||
type ResolverStartLogInput struct {
|
||||
DomainsTotal int
|
||||
TTL int
|
||||
Workers int
|
||||
DNSTimeoutMS int
|
||||
DirectTry int
|
||||
DirectBudgetMS int64
|
||||
WildcardTry int
|
||||
WildcardBudgetMS int64
|
||||
NXEarlyStop bool
|
||||
NXHardQuarantine bool
|
||||
CooldownEnabled bool
|
||||
CooldownMinAttempts int
|
||||
CooldownTimeoutRate int
|
||||
CooldownFailStreak int
|
||||
CooldownBanSec int
|
||||
CooldownMaxBanSec int
|
||||
LiveBatchTarget int
|
||||
LiveBatchMin int
|
||||
LiveBatchMax int
|
||||
LiveBatchNXHeavyPct int
|
||||
LiveBatchNXHeavyMin int
|
||||
LiveBatchNXHeavyMax int
|
||||
StaleKeepSec int
|
||||
PrecheckEverySec int
|
||||
PrecheckMaxDomains int
|
||||
PrecheckForcedEnv bool
|
||||
PrecheckForcedFile bool
|
||||
}
|
||||
|
||||
func LogResolverStart(in ResolverStartLogInput, logf func(string, ...any)) {
|
||||
if logf == nil {
|
||||
return
|
||||
}
|
||||
logf("resolver start: domains=%d ttl=%ds workers=%d dns_timeout_ms=%d", in.DomainsTotal, in.TTL, in.Workers, in.DNSTimeoutMS)
|
||||
logf(
|
||||
"resolver policy: direct_try=%d direct_budget_ms=%d wildcard_try=%d wildcard_budget_ms=%d nx_early_stop=%t nx_hard_quarantine=%t cooldown_enabled=%t cooldown_min_attempts=%d cooldown_timeout_rate=%d cooldown_fail_streak=%d cooldown_ban_sec=%d cooldown_max_ban_sec=%d live_batch_target=%d live_batch_min=%d live_batch_max=%d live_batch_nx_heavy_pct=%d live_batch_nx_heavy_min=%d live_batch_nx_heavy_max=%d stale_keep_sec=%d precheck_every_sec=%d precheck_max=%d precheck_forced_env=%t precheck_forced_file=%t",
|
||||
in.DirectTry,
|
||||
in.DirectBudgetMS,
|
||||
in.WildcardTry,
|
||||
in.WildcardBudgetMS,
|
||||
in.NXEarlyStop,
|
||||
in.NXHardQuarantine,
|
||||
in.CooldownEnabled,
|
||||
in.CooldownMinAttempts,
|
||||
in.CooldownTimeoutRate,
|
||||
in.CooldownFailStreak,
|
||||
in.CooldownBanSec,
|
||||
in.CooldownMaxBanSec,
|
||||
in.LiveBatchTarget,
|
||||
in.LiveBatchMin,
|
||||
in.LiveBatchMax,
|
||||
in.LiveBatchNXHeavyPct,
|
||||
in.LiveBatchNXHeavyMin,
|
||||
in.LiveBatchNXHeavyMax,
|
||||
in.StaleKeepSec,
|
||||
in.PrecheckEverySec,
|
||||
in.PrecheckMaxDomains,
|
||||
in.PrecheckForcedEnv,
|
||||
in.PrecheckForcedFile,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user