This is an automated email from the ASF dual-hosted git repository.
yangyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-rust.git
The following commit(s) were added to refs/heads/main by this push:
new 1225aab Fix: 修复服务无法注册异常 (#132)
1225aab is described below
commit 1225aab2ee587f3f28a0836eeabe70cad93346b3
Author: hubertshelley <[email protected]>
AuthorDate: Tue Apr 11 08:31:00 2023 +0800
Fix: 修复服务无法注册异常 (#132)
* Fix: 修复服务无法注册异常
* Fix: cargo fmt fix
* Fix: 修复cargo test异常
---
common/base/src/url.rs | 5 ++++-
common/utils/src/yaml_util.rs | 3 ++-
config/src/config.rs | 2 +-
remoting/net/src/incoming.rs | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/common/base/src/url.rs b/common/base/src/url.rs
index b5801bb..82b026f 100644
--- a/common/base/src/url.rs
+++ b/common/base/src/url.rs
@@ -155,7 +155,10 @@ impl Url {
// short_url is used for tcp listening
pub fn short_url(&self) -> String {
- format!("{}://{}:{}", self.scheme, self.ip, self.port)
+ format!(
+ "{}://{}:{}/{}",
+ self.scheme, self.ip, self.port, self.service_name
+ )
}
pub fn protocol(&self) -> String {
diff --git a/common/utils/src/yaml_util.rs b/common/utils/src/yaml_util.rs
index f8e0adf..62a6632 100644
--- a/common/utils/src/yaml_util.rs
+++ b/common/utils/src/yaml_util.rs
@@ -63,6 +63,7 @@ pub fn yaml_key_reader(path: PathBuf, key: &str) ->
Result<Option<String>, Error
#[cfg(test)]
mod tests {
+ use serde_yaml::Value;
use std::collections::HashMap;
use crate::{
@@ -77,7 +78,7 @@ mod tests {
.join("utils")
.join("tests")
.join("application.yaml");
- let config = yaml_file_parser::<HashMap<String, HashMap<String,
String>>>(path).unwrap();
+ let config = yaml_file_parser::<HashMap<String, Value>>(path).unwrap();
println!("{:?}", config);
}
diff --git a/config/src/config.rs b/config/src/config.rs
index ba0a089..646873d 100644
--- a/config/src/config.rs
+++ b/config/src/config.rs
@@ -184,7 +184,7 @@ mod tests {
#[test]
fn test_load() {
- logger::init();
+ dubbo_logger::init();
let r = RootConfig::new();
let r = r.load().unwrap();
println!("{:#?}", r);
diff --git a/remoting/net/src/incoming.rs b/remoting/net/src/incoming.rs
index 63624f4..cc6c2a5 100644
--- a/remoting/net/src/incoming.rs
+++ b/remoting/net/src/incoming.rs
@@ -112,7 +112,7 @@ impl Stream for DefaultIncoming {
#[cfg(test)]
mod tests {
- use logger::tracing::debug;
+ use dubbo_logger::tracing::debug;
use tokio::{io::AsyncReadExt, net::TcpListener};
use tokio_stream::wrappers::TcpListenerStream;