feat(seckill): 增加只读预演并强化代理风控切换
This commit is contained in:
@@ -56,7 +56,11 @@ func (a *App) FetchProxy(apiURL string) types.ProxyFetchResult {
|
||||
}
|
||||
|
||||
func extractProxyEndpoints(cfg types.Config, apiURL string, count int) ([]proxyprovider.Endpoint, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
return extractProxyEndpointsWithTimeout(cfg, apiURL, count, 30*time.Second)
|
||||
}
|
||||
|
||||
func extractProxyEndpointsWithTimeout(cfg types.Config, apiURL string, count int, timeout time.Duration) ([]proxyprovider.Endpoint, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
service := proxyprovider.NewService()
|
||||
endpoints, err := service.ExtractWithWhitelist(ctx, apiURL, count, proxyprovider.WhitelistConfig{
|
||||
|
||||
Reference in New Issue
Block a user