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:
parent
9f6cecacd4
commit
cfa7dba465
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue