From f70e359f14e0a188072fbc7204e7ec34d6eec0e2 Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Thu, 15 Aug 2024 03:24:27 -0400 Subject: [PATCH] avoid warn log on refresh repo task if no repo configured --- bin/core/src/api/write/repo.rs | 5 +++++ bin/core/src/helpers/sync/mod.rs | 5 ++++- bin/core/src/resource/repo.rs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/core/src/api/write/repo.rs b/bin/core/src/api/write/repo.rs index 904969776..41751f7b6 100644 --- a/bin/core/src/api/write/repo.rs +++ b/bin/core/src/api/write/repo.rs @@ -90,6 +90,11 @@ impl Resolve for State { ) .await?; + if repo.config.repo.is_empty() { + // Nothing to do + return Ok(NoData {}); + } + let config = core_config(); let repo_dir = config.repo_directory.join(random_string(10)); diff --git a/bin/core/src/helpers/sync/mod.rs b/bin/core/src/helpers/sync/mod.rs index 284c7db54..f64455736 100644 --- a/bin/core/src/helpers/sync/mod.rs +++ b/bin/core/src/helpers/sync/mod.rs @@ -11,11 +11,11 @@ use crate::{ }; // pub mod deployment; +pub mod deploy; pub mod remote; pub mod resource; pub mod user_groups; pub mod variables; -pub mod deploy; mod file; mod resources; @@ -47,6 +47,9 @@ async fn refresh_syncs() { return; }; for sync in syncs { + if sync.config.repo.is_empty() { + continue; + } State .resolve( RefreshResourceSyncPending { sync: sync.id }, diff --git a/bin/core/src/resource/repo.rs b/bin/core/src/resource/repo.rs index 01fcb7b0d..54b3e5b3f 100644 --- a/bin/core/src/resource/repo.rs +++ b/bin/core/src/resource/repo.rs @@ -195,7 +195,7 @@ pub async fn refresh_repo_state_cache() { } .await .inspect_err(|e| { - error!("failed to refresh repo state cache | {e:#}") + warn!("failed to refresh repo state cache | {e:#}") }); }