refactor(ci/Dockerfile.dfinit, dragonfly-client/src/dynconfig/mod.rs): format and optimize code (#1117)

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2025-04-27 10:13:17 +08:00 committed by GitHub
parent 9f6cecacd4
commit cfa7dba465
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -1,8 +1,8 @@
FROM public.ecr.aws/docker/library/rust:1.82.0 AS builder FROM public.ecr.aws/docker/library/rust:1.82.0 AS builder
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
openssl libclang-dev pkg-config protobuf-compiler \ openssl libclang-dev pkg-config protobuf-compiler \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /app/client WORKDIR /app/client

View File

@ -25,7 +25,7 @@ use dragonfly_client_core::{Error, Result};
use std::sync::Arc; use std::sync::Arc;
use tokio::sync::{mpsc, Mutex, RwLock}; use tokio::sync::{mpsc, Mutex, RwLock};
use tonic_health::pb::health_check_response::ServingStatus; use tonic_health::pb::health_check_response::ServingStatus;
use tracing::{error, info, instrument}; use tracing::{debug, error, info, instrument};
use url::Url; use url::Url;
/// Data is the dynamic configuration of the dfdaemon. /// Data is the dynamic configuration of the dfdaemon.
@ -98,9 +98,10 @@ impl Dynconfig {
loop { loop {
tokio::select! { tokio::select! {
_ = interval.tick() => { _ = interval.tick() => {
if let Err(err) = self.refresh().await { match self.refresh().await {
error!("refresh dynconfig failed: {}", err); Err(err) => error!("refresh dynconfig failed: {}", err),
}; Ok(_) => debug!("refresh dynconfig success"),
}
} }
_ = shutdown.recv() => { _ = shutdown.recv() => {
// Dynconfig server shutting down with signals. // Dynconfig server shutting down with signals.