Skip to content

Commit a995af1

Browse files
author
Ben Iofel
committed
reuse code
1 parent 0916735 commit a995af1

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

internal/flypg/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ func (n *Node) migrateNodeNameIfNeeded(ctx context.Context, repConn *pgx.Conn) e
578578
return fmt.Errorf("failed to clone standby: %s", err)
579579
}
580580

581-
if err := n.PGConfig.reload(ctx); err != nil {
581+
if err := admin.ReloadPostgresConfig(ctx, repConn); err != nil {
582582
return fmt.Errorf("failed to reload postgresql: %s", err)
583583
}
584584
}

internal/flypg/pg.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,3 @@ func diskSizeInBytes(dir string) (uint64, error) {
606606
}
607607
return stat.Blocks * uint64(stat.Bsize), nil
608608
}
609-
610-
func (*PGConfig) reload(ctx context.Context) error {
611-
_, err := utils.RunCmd(ctx, "postgres", "pg_ctl", "-D", "/data/postgresql/", "reload")
612-
if err != nil {
613-
return fmt.Errorf("failed to reload postgres: %s", err)
614-
}
615-
return nil
616-
}

0 commit comments

Comments
 (0)