(
operation: (
client: ClickHouseClient,
ctx: { url: string; index: number }
) => Promise<T>
)
| 256 | * (useful for adding `host` to log lines / metrics). |
| 257 | */ |
| 258 | export async function withRetry<T>( |
| 259 | operation: ( |
| 260 | client: ClickHouseClient, |
| 261 | ctx: { url: string; index: number } |
| 262 | ) => Promise<T> |
| 263 | ): Promise<T> { |
| 264 | return withRoundRobinRetry(picker, operation, logger); |
| 265 | } |
| 266 | |
| 267 | /** Best-effort URL → hostname extraction for log labels. */ |
| 268 | function urlHostname(url: string | undefined): string | undefined { |
no test coverage detected