From 0c085b42d84c571ef3ff86a6eb495ce1737d87cd Mon Sep 17 00:00:00 2001 From: ljl <17743125563@163.com> Date: Fri, 17 Nov 2023 10:36:58 +0800 Subject: [PATCH] iam:fix role add async task. --- support/iam/src/console_interface/api/iam_ci_role_api.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/iam/src/console_interface/api/iam_ci_role_api.rs b/support/iam/src/console_interface/api/iam_ci_role_api.rs index 29c27ceaa..971cd9303 100644 --- a/support/iam/src/console_interface/api/iam_ci_role_api.rs +++ b/support/iam/src/console_interface/api/iam_ci_role_api.rs @@ -75,13 +75,13 @@ impl IamCiRoleApi { ) -> TardisApiResult> { add_remote_ip(request, &ctx.0).await?; let ctx = ctx.0; - let apps_split: Vec<&str> = app_ids.0.split(',').collect::>(); - let account_split: Vec<&str> = account_ids.0.split(',').collect::>(); let ctx_clone = ctx.clone(); ctx.add_async_task(Box::new(|| { Box::pin(async move { let task_handle = tokio::spawn(async move { let funs = iam_constants::get_tardis_inst(); + let apps_split: Vec<&str> = app_ids.0.split(',').collect::>(); + let account_split: Vec<&str> = account_ids.0.split(',').collect::>(); for app_id in apps_split { let mock_app_ctx = IamCertServ::try_use_app_ctx(ctx_clone.clone(), Some(app_id.to_string())).unwrap_or(ctx_clone.clone()); for account_id in account_split.clone() {