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:
Mahmoud Emad
2025-01-06 15:43:33 +02:00
parent 51fb692f15
commit a19867c00b

View File

@@ -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