From 9633c799efba50e0ff9fbd434f7a035375159d15 Mon Sep 17 00:00:00 2001 From: CherishCai <785427346@qq.com> Date: Fri, 29 Sep 2023 20:12:05 +0800 Subject: [PATCH] bump: version=0.3.2 --- Cargo.toml | 4 ++-- README.md | 7 +++++++ src/lib.rs | 5 +++++ src/naming.rs | 3 +++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2320577..5c677b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nacos-sdk-rust-binding-py" -version = "0.3.1" +version = "0.3.2" edition = "2021" license = "Apache-2.0" publish = false @@ -20,7 +20,7 @@ doc = false [dependencies] pyo3 = "0.18" -nacos-sdk = { version = "0.3.1", features = ["default"] } +nacos-sdk = { version = "0.3.2", features = ["default"] } #nacos-sdk = { git = "https://github.com/nacos-group/nacos-sdk-rust.git", features = ["default"] } tracing-subscriber = { version = "0.3", features = ["default"] } diff --git a/README.md b/README.md index effaa7d..d9265ec 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ pip install nacos-sdk-rust-binding-py 环境变量 `NACOS_CLIENT_COMMON_THREAD_CORES=4` 可设置客户端核心线程数,默认是 CPU 数目 num_cpus +环境变量 `ENV_NACOS_CLIENT_NAMING_PUSH_EMPTY_PROTECTION=false` 可关闭 Naming 防推空保护,默认 true + +更多环境变量请看 `nacos-sdk-rust` 的[文档说明](https://github.com/nacos-group/nacos-sdk-rust) + ### Definition of ClientOptions ```python @@ -39,6 +43,9 @@ class ClientOptions: # Password for Auth #[pyo3(set, get)] password: Option, + # naming push_empty_protection, default true + #[pyo3(set, get)] + naming_push_empty_protection: Option, # Init def __init__(self, server_addr, namespace, app_name, username, password): diff --git a/src/lib.rs b/src/lib.rs index 2c4d5ec..cbdb02b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,6 +70,9 @@ pub struct ClientOptions { /// Password for Auth #[pyo3(set, get)] pub password: Option, + /// naming push_empty_protection, default true + #[pyo3(set, get)] + pub naming_push_empty_protection: Option, } #[pymethods] @@ -81,6 +84,7 @@ impl ClientOptions { app_name: Option, username: Option, password: Option, + naming_push_empty_protection: Option, ) -> PyResult { Ok(Self { server_addr, @@ -88,6 +92,7 @@ impl ClientOptions { app_name, username, password, + naming_push_empty_protection, }) } } diff --git a/src/naming.rs b/src/naming.rs index 3435906..07c2940 100644 --- a/src/naming.rs +++ b/src/naming.rs @@ -26,6 +26,9 @@ impl NacosNamingClient { client_options .app_name .unwrap_or(nacos_sdk::api::constants::UNKNOWN.to_string()), + ) + .naming_push_empty_protection( + client_options.naming_push_empty_protection.unwrap_or(true), ); // need enable_auth_plugin_http with username & password