Skip to content

Commit

Permalink
chore: do not throw error on chmod failure in embedded mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Oct 11, 2023
1 parent 83a32a0 commit 3a88324
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/db/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ func IsConnected() bool {

func embeddedDB() error {
embeddedPath := strings.TrimSuffix(strings.TrimPrefix(ConnectionString, "embedded://"), "/")
err := os.Chmod(embeddedPath, 0750)
if err != nil {
logger.Warnf("Error changing permission of dataPath: %v, Error: %v", embeddedPath, err)
}
_ = os.Chmod(embeddedPath, 0750)

logger.Infof("Starting embedded postgres server at %s", embeddedPath)

Expand All @@ -72,8 +69,7 @@ func embeddedDB() error {
Username("postgres").Password("postgres").
Database("canary"))
ConnectionString = "postgres://postgres:postgres@localhost:6432/canary?sslmode=disable"
err = PostgresServer.Start()
if err != nil {
if err := PostgresServer.Start(); err != nil {
return fmt.Errorf("error starting embedded postgres: %v", err)
}
return nil
Expand Down

0 comments on commit 3a88324

Please sign in to comment.