Skip to content

Commit e2c0716

Browse files
authored
STAC-24021: Increase Clickhouse Backup API timeouts (#10)
1 parent a3310e9 commit e2c0716

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/clickhouse/check_and_finalize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func checkAndFinalize(appCtx *app.Context, operationID string, waitForComplete b
8282
}
8383

8484
// Restore still running
85-
appCtx.Logger.Infof("Restore is still in progress (status: %s)", status)
85+
appCtx.Logger.Infof("Restore is still in progress (status: %s)", status.Status)
8686

8787
// Status is "in progress" or other
8888
if waitForComplete {

internal/clients/clickhouse/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
const (
1717
defaultHTTPClientTimeout = 30 * time.Second
18-
defaultOperationTimeout = 30 * time.Second
18+
defaultOperationTimeout = 900 * time.Second
1919
defaultOperationPollInterval = 2 * time.Second
2020
)
2121

@@ -182,7 +182,7 @@ func (c *Client) waitForAction(ctx context.Context, operationID string, timeout,
182182
case <-ticker.C:
183183
action, err := c.GetRestoreStatus(ctx, operationID)
184184
if err != nil {
185-
return nil, fmt.Errorf("fail to get action with operation id: %s", operationID)
185+
return nil, fmt.Errorf("fail to get action with operation id=%s : %w", operationID, err)
186186
}
187187
if action.Status == "success" || action.Status == "error" {
188188
return action, nil

0 commit comments

Comments
 (0)