fix: Improve Postgresql healthcheck
- Remove unnecessary error return in `installed_()`. - Remove `workdir` from `startupcmd()` as it's not needed. - Simplify healthcheck to only return boolean. Co-authored-by: mariobassem12 <mariobassem12@gmail.com>
This commit is contained in:
@@ -10,11 +10,12 @@ fn installed_() !bool {
|
||||
mut cfg := get()!
|
||||
mut podman := podman_installer.get()!
|
||||
podman.install()!
|
||||
|
||||
cmd := 'podman healthcheck run ${cfg.container_name}'
|
||||
result := os.execute(cmd)
|
||||
|
||||
if result.exit_code != 0 {
|
||||
return error("Postgresql container isn't running: ${result.output}")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -37,7 +38,6 @@ fn startupcmd() ![]zinit.ZProcessNewArgs {
|
||||
res << zinit.ZProcessNewArgs{
|
||||
name: 'postgresql'
|
||||
cmd: cmd
|
||||
workdir: cfg.volume_path
|
||||
startuptype: .zinit
|
||||
}
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user