Skip to content

Commit

Permalink
Revert "accelerate postgres restore with jobs"
Browse files Browse the repository at this point in the history
This reverts commit a516766.
  • Loading branch information
Biptaste committed Jun 18, 2024
1 parent 539087c commit f3883a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions actions/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"strings"

"github.com/Songmu/prompter"
Expand Down Expand Up @@ -296,7 +295,7 @@ func restorePostgres(ctx domain.ExecutionContext, containerID string, dumpFilena
ext := filepath.Ext(dumpFilename)
database := strings.Replace(dumpFilename, ext, "", 1)

cmd := domain.NewCommand([]string{"docker", "exec", "-i", "-e", fmt.Sprintf("PGPASSWORD=\"%s\"", password), containerID, "pg_restore", fmt.Sprintf("--username=%s", user), "-d", database, "-c", fmt.Sprintf("--jobs=%d", runtime.NumCPU())}, verbose)
cmd := domain.NewCommand([]string{"docker", "exec", "-i", "-e", fmt.Sprintf("PGPASSWORD=\"%s\"", password), containerID, "pg_restore", fmt.Sprintf("--username=%s", user), "-d", database, "-c"}, verbose)
cmd.ExecuteWithStdin(postgresDumpReader)
}

Expand Down

0 comments on commit f3883a0

Please sign in to comment.