From cac1366a2c08a979407d49439d67ae5b647287c9 Mon Sep 17 00:00:00 2001 From: chesedo Date: Thu, 21 Sep 2023 09:49:30 +0200 Subject: [PATCH] bug: project entering a state loop --- gateway/src/project.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gateway/src/project.rs b/gateway/src/project.rs index bebc509cd..fa4e4d3fb 100644 --- a/gateway/src/project.rs +++ b/gateway/src/project.rs @@ -502,11 +502,13 @@ where ContainerStateStatusEnum::RUNNING => { Self::Started(ProjectStarted::new(container, VecDeque::new())) } - ContainerStateStatusEnum::CREATED => Self::Starting(ProjectStarting { + // We can reach the starting state because either: + // - The project was created for the first time + // - It crashed and we are restarting it + ContainerStateStatusEnum::CREATED | ContainerStateStatusEnum::EXITED => Self::Starting(ProjectStarting { container, restart_count, }), - ContainerStateStatusEnum::EXITED => Self::Restarting(ProjectRestarting { container, restart_count: 0 }), _ => { return Err(Error::custom( ErrorKind::Internal,