@@ -23,9 +23,7 @@ use generated::{
2323 } ,
2424 workflow:: {
2525 types:: { AppCleanupFailed , AppInitModifyError } ,
26- workflow:: {
27- self as workflow_import, AppInitError , AppInitNoCleanupError , ObeliskConfig ,
28- } ,
26+ workflow:: { self as workflow_import, AppInitError , ObeliskConfig } ,
2927 } ,
3028 } ,
3129} ;
@@ -174,7 +172,7 @@ fn app_modify_without_cleanup(
174172 Ok ( get_secret_keys ( config) )
175173}
176174
177- fn cleanup ( app_name : & str , modify_error : Option < AppInitModifyError > ) -> AppInitError {
175+ fn cleanup ( app_name : & str , modify_error : AppInitModifyError ) -> AppInitError {
178176 // Delete the app with force.
179177 match activity_fly_http:: apps:: delete ( app_name, true ) {
180178 Ok ( ( ) ) => AppInitError :: CleanupOk ,
@@ -203,9 +201,8 @@ impl Guest for Component {
203201 fn app_modify_no_cleanup_on_error (
204202 app_name : String ,
205203 config : ObeliskConfig ,
206- ) -> Result < Vec < String > , AppInitNoCleanupError > {
204+ ) -> Result < Vec < String > , AppInitModifyError > {
207205 app_modify_without_cleanup ( & app_name, config)
208- . map_err ( AppInitNoCleanupError :: AppInitModifyError )
209206 }
210207
211208 fn app_init (
@@ -217,10 +214,7 @@ impl Guest for Component {
217214 app_create ( & org_slug, & app_name) ?;
218215 // Launch a child workflow by using import
219216 let required_secrets = workflow_import:: app_modify_no_cleanup_on_error ( & app_name, & config)
220- . map_err ( |err| match err {
221- AppInitNoCleanupError :: AppInitModifyError ( err) => cleanup ( & app_name, Some ( err) ) ,
222- AppInitNoCleanupError :: ExecutionFailed => cleanup ( & app_name, None ) ,
223- } ) ?;
217+ . map_err ( |err| cleanup ( & app_name, err) ) ?;
224218 // Sleep until all requested secrets are stored in the app.
225219 let required_secrets: HashSet < _ > = required_secrets. into_iter ( ) . collect ( ) ;
226220 while !required_secrets. is_empty ( ) {
0 commit comments