Skip to content

Commit

Permalink
reuse code
Browse files Browse the repository at this point in the history
  • Loading branch information
benwaffle committed Aug 2, 2024
1 parent 0916735 commit a995af1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion internal/flypg/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func (n *Node) migrateNodeNameIfNeeded(ctx context.Context, repConn *pgx.Conn) e
return fmt.Errorf("failed to clone standby: %s", err)
}

if err := n.PGConfig.reload(ctx); err != nil {
if err := admin.ReloadPostgresConfig(ctx, repConn); err != nil {
return fmt.Errorf("failed to reload postgresql: %s", err)
}
}
Expand Down
8 changes: 0 additions & 8 deletions internal/flypg/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,3 @@ func diskSizeInBytes(dir string) (uint64, error) {
}
return stat.Blocks * uint64(stat.Bsize), nil
}

func (*PGConfig) reload(ctx context.Context) error {
_, err := utils.RunCmd(ctx, "postgres", "pg_ctl", "-D", "/data/postgresql/", "reload")
if err != nil {
return fmt.Errorf("failed to reload postgres: %s", err)
}
return nil
}

0 comments on commit a995af1

Please sign in to comment.