feat: configurable cluster timeout (CLUSTER_TIMEOUT_MIN) and use in TUI backup

This commit is contained in:
2025-11-05 11:53:30 +00:00
parent fa337dfeac
commit 063184ddc9
3 changed files with 11 additions and 1 deletions

View File

@ -88,7 +88,9 @@ type backupCompleteMsg struct {
func executeBackupWithTUIProgress(cfg *config.Config, log logger.Logger, backupType, dbName string, ratio int, reporter *TUIProgressReporter) tea.Cmd {
return func() tea.Msg {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
// Use configurable cluster timeout (minutes) from config; default set in config.New()
clusterTimeout := time.Duration(cfg.ClusterTimeoutMinutes) * time.Minute
ctx, cancel := context.WithTimeout(context.Background(), clusterTimeout)
defer cancel()
start := time.Now()