mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
retry failed pause (#985)
This commit is contained in:
@@ -569,11 +569,24 @@ async fn start(shared: &ManagerSharedState) -> Result<(), Error> {
|
|||||||
|
|
||||||
#[instrument(skip(shared))]
|
#[instrument(skip(shared))]
|
||||||
async fn pause(shared: &ManagerSharedState) -> Result<(), Error> {
|
async fn pause(shared: &ManagerSharedState) -> Result<(), Error> {
|
||||||
shared
|
let mut res = Ok(());
|
||||||
.ctx
|
for _retry in 0..5 {
|
||||||
.docker
|
res = shared
|
||||||
.pause_container(&shared.container_name)
|
.ctx
|
||||||
.await?;
|
.docker
|
||||||
|
.pause_container(&shared.container_name)
|
||||||
|
.await;
|
||||||
|
if !matches!(
|
||||||
|
res,
|
||||||
|
Err(bollard::errors::Error::DockerResponseServerError {
|
||||||
|
status_code: 500,
|
||||||
|
..
|
||||||
|
}),
|
||||||
|
) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res?;
|
||||||
shared
|
shared
|
||||||
.status
|
.status
|
||||||
.store(Status::Paused as usize, std::sync::atomic::Ordering::SeqCst);
|
.store(Status::Paused as usize, std::sync::atomic::Ordering::SeqCst);
|
||||||
|
|||||||
Reference in New Issue
Block a user