Очередь job получила lease и fencing, телеметрия и прогресс deploy сохраняются, ревизия пишет manifest входов. Обновление префиксов не переписывает неизменённый снимок, большие наборы идут через COPY, а устаревшая ревизия не попадает в deploy. Бандл ноды кэшируется, prune и постановка job больше не держат горячий путь. Co-authored-by: Cursor <[email protected]>
30 lines
712 B
Go
30 lines
712 B
Go
package pipeline
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"evobgp/internal/httpclient"
|
|
)
|
|
|
|
// UpstreamHTTPDo performs an outbound GET/POST with circuit breaker + retries (CDN, previews).
|
|
func UpstreamHTTPDo(ctx context.Context, hc *http.Client, req *http.Request) (*http.Response, error) {
|
|
return upstreamHTTPDo(ctx, hc, req)
|
|
}
|
|
|
|
func upstreamHTTPDo(ctx context.Context, hc *http.Client, req *http.Request) (*http.Response, error) {
|
|
hc, err := secureCDNClient(hc)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
resp, err := httpclient.DoWithBreaker(ctx, hc, req, 3)
|
|
if err != nil {
|
|
if req.URL != nil {
|
|
return nil, fmt.Errorf("cdn fetch %s: %w", req.URL.String(), err)
|
|
}
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|