feat: 测试路径

This commit is contained in:
tbphp
2025-07-23 14:35:52 +08:00
parent e40f33190a
commit ec04555a50
10 changed files with 164 additions and 79 deletions

View File

@@ -23,12 +23,13 @@ type UpstreamInfo struct {
// BaseChannel provides common functionality for channel proxies.
type BaseChannel struct {
Name string
Upstreams []UpstreamInfo
HTTPClient *http.Client
StreamClient *http.Client
TestModel string
upstreamLock sync.Mutex
Name string
Upstreams []UpstreamInfo
HTTPClient *http.Client
StreamClient *http.Client
TestModel string
ValidationEndpoint string
upstreamLock sync.Mutex
// Cached fields from the group for stale check
channelType string
@@ -96,6 +97,9 @@ func (b *BaseChannel) IsConfigStale(group *models.Group) bool {
if b.TestModel != group.TestModel {
return true
}
if b.ValidationEndpoint != group.ValidationEndpoint {
return true
}
if !bytes.Equal(b.groupUpstreams, group.Upstreams) {
return true
}