Skip to content

Commit 525e77b

Browse files
committed
fix(apps): Make apps.delete idempotent
1 parent f8bae87 commit 525e77b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • activity/fly-http/impl/src

activity/fly-http/impl/src/app.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ async fn delete(app_name: AppName, force: bool) -> Result<(), anyhow::Error> {
151151
.body(wstd::io::empty())?;
152152

153153
let response = Client::new().send(request).await?;
154-
if response.status().is_success() {
154+
let status = response.status();
155+
// Idempotency: If app was already deleted, treat it a success.
156+
if status.is_success() || status == StatusCode::NOT_FOUND {
155157
Ok(())
156158
} else {
157159
let error_status = response.status();

0 commit comments

Comments
 (0)