Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FIX (backups): Increase timeout from 1 hour to 23 hours

Rostislav Dugin72a02ad73907
diff --git a/backend/.gitignore b/backend/.gitignore
index d10186d4..eb0bdc5c 100644
--- a/backend/.gitignore
+++ b/backend/.gitignore
@@ -11,4 +11,5 @@ swagger/swagger.json
swagger/swagger.yaml
postgresus-backend.exe
ui/build/*
-pgdata-for-restore/
\ No newline at end of file
+pgdata-for-restore/
+temp/
\ No newline at end of file
diff --git a/backend/internal/features/backups/backups/usecases/postgresql/create_backup_uc.go b/backend/internal/features/backups/backups/usecases/postgresql/create_backup_uc.go
index bfb7e94c..83301bf9 100644
--- a/backend/internal/features/backups/backups/usecases/postgresql/create_backup_uc.go
+++ b/backend/internal/features/backups/backups/usecases/postgresql/create_backup_uc.go
@@ -100,7 +100,9 @@ func (uc *CreatePostgresqlBackupUsecase) streamToStorage(
) error {
uc.logger.Info("Streaming PostgreSQL backup to storage", "pgBin", pgBin, "args", args)
- ctx, cancel := context.WithTimeout(context.Background(), 60*time.Minute)
+ // if backup not fit into 23 hours, Postgresus
+ // seems not to work for such database size
+ ctx, cancel := context.WithTimeout(context.Background(), 23*time.Hour)
defer cancel()
// Monitor for shutdown and cancel context if needed