pub async fn create_new(&self) -> Result<String> {
        let start = Instant::now();
        let config = Arc::clone(&self.config);

        let mut task_arn = self
            .get_existing_task(config.hcomb_cluster_name.clone())
            .await;

        if task_arn.is_none() {
            task_arn = Some(
                self.start_task(
                    config.hcomb_task_def_arn.clone(),
                    config.hcomb_cluster_name.clone(),
                    config.public_subnets.clone(),
                    config.hcomb_task_sg_id.clone(),
                )
                .await?,
            );
            println!("[fuse] task started");
            tokio::time::sleep(Duration::from_secs(1)).await;
        }

        let result = self
            .wait_for_provisioning(task_arn.unwrap(), config.hcomb_cluster_name.clone())
            .await?;

        println!(
            "[fuse] took {}ms to create/find task",
            start.elapsed().as_millis()
        );

        Ok(result)
    }
/// Create a new fargate task and returns private IP.
/// The task might not be ready to receive requests yet.
Create a new fargate task and returns private IP.
The task might not be ready to receive requests yet.
Create a new fargate task and returns private IP . The task might not be ready to receive requests yet .
pub async fn create_new(&self) -> Result<String> {
        let start = Instant::now();
        let config = Arc::clone(&self.config);
        let mut task_arn = self
            .get_existing_task(config.hcomb_cluster_name.clone())
            .await;
        if task_arn.is_none() {
            task_arn = Some(
                self.start_task(
                    config.hcomb_task_def_arn.clone(),
                    config.hcomb_cluster_name.clone(),
                    config.public_subnets.clone(),
                    config.hcomb_task_sg_id.clone(),
                )
                .await?,
            );
            println!("[fuse] task started");
            tokio::time::sleep(Duration::from_secs(1)).await;
        }
        let result = self
            .wait_for_provisioning(task_arn.unwrap(), config.hcomb_cluster_name.clone())
            .await?;
        println!(
            "[fuse] took {}ms to create/find task",
            start.elapsed().as_millis()
        );
        Ok(result)
    }
pub async fn create_new ( & self ) -> Result < String > { let start = Instant :: now ( ) ; let config = Arc :: clone ( & self . config ) ; let mut task_arn = self . get_existing_task ( config . hcomb_cluster_name . clone ( ) ) . await ; if task_arn . is_none ( ) { task_arn = Some ( self . start_task ( config . hcomb_task_def_arn . clone ( ) , config . hcomb_cluster_name . clone ( ) , config . public_subnets . clone ( ) , config . hcomb_task_sg_id . clone ( ) , ) . await ? , ) ; println ! ( " " ) ; tokio :: time :: sleep ( Duration :: from_secs ( 1 ) ) . await ; } let result = self . wait_for_provisioning ( task_arn . unwrap ( ) , config . hcomb_cluster_name . clone ( ) ) . await ? ; println ! ( " " start elapsed ( ) as_millis ( ) ) ; Ok ( result ) }
Create a new fargate task and returns private IP.
Create a new fargate task and returns private IP .
&self
&self