feat: pg_isready in postgres import

Fixed issue where arguments passed to `compose stop` weren't passed to
the underlying command. Added pg_isready call between each command call
in restore script.
This commit is contained in:
2023-11-27 16:33:00 +01:00
parent 2754a3bb30
commit 98f02c1c08
3 changed files with 23 additions and 4 deletions

View File

@@ -4,8 +4,9 @@ use std::{
ffi::OsStr,
fmt::Display,
fs::{File, OpenOptions},
os::unix::process::CommandExt,
path::PathBuf,
process::{Command, Stdio},
process::{Child, Command, Stdio},
};
use crate::debug_println;
@@ -81,6 +82,10 @@ impl CommandBuilder {
Ok(())
}
pub fn spawn(mut self) -> Result<(Child)> {
Ok(self.build()?.spawn()?)
}
pub fn exec_redirect_stdout(mut self, stdio: Stdio) -> Result<()> {
self.build()?.stdout(stdio).spawn()?.wait()?;
Ok(())