MCPcopy Create free account
hub / github.com/V2RaySSR/RealityChecker / CheckDomains

Method CheckDomains

internal/core/engine.go:84–109  ·  view source on GitHub ↗

CheckDomains 批量检测域名(移除并发控制,由调用方管理)

(ctx context.Context, domains []string)

Source from the content-addressed store, hash-verified

82
83// CheckDomains 批量检测域名(移除并发控制,由调用方管理)
84func (e *Engine) CheckDomains(ctx context.Context, domains []string) ([]*types.DetectionResult, error) {
85 if !e.running {
86 return nil, fmt.Errorf("引擎未运行")
87 }
88
89 if len(domains) == 0 {
90 return []*types.DetectionResult{}, nil
91 }
92
93 // 移除Engine层的并发控制,由Batch Manager统一管理
94 results := make([]*types.DetectionResult, len(domains))
95
96 for i, domain := range domains {
97 // 直接执行检测,不进行并发控制
98 result, err := e.pipeline.Execute(ctx, domain)
99 if err != nil {
100 result = &types.DetectionResult{
101 Domain: domain,
102 Error: err,
103 }
104 }
105 results[i] = result
106 }
107
108 return results, nil
109}
110
111// CheckDomainsStream 流式批量检测域名
112func (e *Engine) CheckDomainsStream(ctx context.Context, domains []string) (<-chan *types.DetectionResult, error) {

Callers 2

executeCSVMethod · 0.45
executeBatchMethod · 0.45

Calls 1

ExecuteMethod · 0.65

Tested by

no test coverage detected