From d2801adeca07052ff9249f2d51d77938b75ec3d6 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Wed, 27 Sep 2023 19:34:21 +0530 Subject: [PATCH] chore: return Ctx and not ArcCtx --- src/ctx.rs | 6 +++--- src/runner/init_scripts.rs | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ctx.rs b/src/ctx.rs index 638814f..0168f1f 100644 --- a/src/ctx.rs +++ b/src/ctx.rs @@ -39,17 +39,17 @@ pub struct Ctx { } impl Ctx { - pub async fn new(settings: Settings) -> Arc { + pub async fn new(settings: Settings) -> Self { let results = HashMap::default(); let results = Arc::new(RwLock::new(results)); let client = Client::default(); let db = get_db(&settings).await; - Arc::new(Self { + Self { settings, client, db, results, docker: Arc::new(Docker::new()), - }) + } } } diff --git a/src/runner/init_scripts.rs b/src/runner/init_scripts.rs index b59b4dc..bc51949 100644 --- a/src/runner/init_scripts.rs +++ b/src/runner/init_scripts.rs @@ -48,6 +48,8 @@ pub fn launch_init_containers(ctx: &AppCtx, target: &Target) -> Option = HashMap::new();