From cfa7dba465ca4227641bfc193425f1d4cc9a68cc Mon Sep 17 00:00:00 2001 From: yxxhero <11087727+yxxhero@users.noreply.github.com> Date: Sun, 27 Apr 2025 10:13:17 +0800 Subject: [PATCH] refactor(ci/Dockerfile.dfinit, dragonfly-client/src/dynconfig/mod.rs): format and optimize code (#1117) Signed-off-by: yxxhero --- ci/Dockerfile.dfinit | 4 ++-- dragonfly-client/src/dynconfig/mod.rs | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ci/Dockerfile.dfinit b/ci/Dockerfile.dfinit index 01cc8040..c84c793a 100644 --- a/ci/Dockerfile.dfinit +++ b/ci/Dockerfile.dfinit @@ -1,8 +1,8 @@ FROM public.ecr.aws/docker/library/rust:1.82.0 AS builder RUN apt-get update && apt-get install -y \ - openssl libclang-dev pkg-config protobuf-compiler \ - && rm -rf /var/lib/apt/lists/* + openssl libclang-dev pkg-config protobuf-compiler \ + && rm -rf /var/lib/apt/lists/* WORKDIR /app/client diff --git a/dragonfly-client/src/dynconfig/mod.rs b/dragonfly-client/src/dynconfig/mod.rs index 93cabdee..536b9287 100644 --- a/dragonfly-client/src/dynconfig/mod.rs +++ b/dragonfly-client/src/dynconfig/mod.rs @@ -25,7 +25,7 @@ use dragonfly_client_core::{Error, Result}; use std::sync::Arc; use tokio::sync::{mpsc, Mutex, RwLock}; use tonic_health::pb::health_check_response::ServingStatus; -use tracing::{error, info, instrument}; +use tracing::{debug, error, info, instrument}; use url::Url; /// Data is the dynamic configuration of the dfdaemon. @@ -98,9 +98,10 @@ impl Dynconfig { loop { tokio::select! { _ = interval.tick() => { - if let Err(err) = self.refresh().await { - error!("refresh dynconfig failed: {}", err); - }; + match self.refresh().await { + Err(err) => error!("refresh dynconfig failed: {}", err), + Ok(_) => debug!("refresh dynconfig success"), + } } _ = shutdown.recv() => { // Dynconfig server shutting down with signals.