mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +02:00
feat(cloud): Kill containers before removing them for faster destruction
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
d89c547f2a
commit
862d33b017
1 changed files with 8 additions and 0 deletions
|
|
@ -499,6 +499,14 @@ impl Cloud {
|
||||||
|
|
||||||
pub async fn destroy(self, docker: &Docker) -> Result<()> {
|
pub async fn destroy(self, docker: &Docker) -> Result<()> {
|
||||||
for container in self.containers {
|
for container in self.containers {
|
||||||
|
docker
|
||||||
|
.kill_container(
|
||||||
|
container.trim_start_matches('/'),
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.into_diagnostic()
|
||||||
|
.wrap_err("Failed to kill container")?;
|
||||||
docker
|
docker
|
||||||
.remove_container(
|
.remove_container(
|
||||||
container.trim_start_matches('/'),
|
container.trim_start_matches('/'),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue