We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef7ad4b commit 56babb8Copy full SHA for 56babb8
pkg/management/postgres/pidfile.go
@@ -91,9 +91,13 @@ func (instance *Instance) CheckForExistingPostmaster(postgresExecutable string)
91
// cleanUpStalePid is called to clean up the files left around by a crashed PostgreSQL instance.
92
// It removes the PostgreSQL pid file and the content of the socket directory.
93
func (instance *Instance) cleanUpStalePid(pidFile string) error {
94
- if err := os.Remove(pidFile); err != nil {
+ if err := os.Remove(pidFile); err != nil && !os.IsNotExist(err) {
95
return err
96
}
97
98
- return fileutils.RemoveDirectoryContent(instance.SocketDirectory)
+ if err := fileutils.RemoveDirectoryContent(instance.SocketDirectory); err != nil && !os.IsNotExist(err) {
99
+ return err
100
+ }
101
+
102
+ return nil
103
0 commit comments