Skip to content

Commit 7d41873

Browse files
authored
Merge pull request #37 from fly-apps/trunc_repmgr_conf
Truncate repmgr config on initialize
2 parents a166ff2 + 1639bbc commit 7d41873

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/flypg/repmgr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (r *RepMgr) NewRemoteConnection(ctx context.Context, hostname string) (*pgx
7272
func (r *RepMgr) initialize() error {
7373
r.setDefaults()
7474

75-
f, err := os.OpenFile(r.ConfigPath, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
75+
f, err := os.OpenFile(r.ConfigPath, os.O_APPEND|os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
7676
if err != nil {
7777
return nil
7878
}

0 commit comments

Comments
 (0)