From bfa0071f906041714f89a89db29a47b75c6da225 Mon Sep 17 00:00:00 2001 From: alyssa Date: Sun, 20 Apr 2025 18:47:29 +0000 Subject: [PATCH] feat(gateway): runtime_config_key in config --- crates/gateway/src/main.rs | 6 +++++- crates/libpk/src/_config.rs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/gateway/src/main.rs b/crates/gateway/src/main.rs index 3864d482..85082c83 100644 --- a/crates/gateway/src/main.rs +++ b/crates/gateway/src/main.rs @@ -35,7 +35,11 @@ async fn real_main() -> anyhow::Result<()> { let runtime_config = Arc::new( RuntimeConfig::new( redis.clone(), - format!("gateway:{}", cluster_config().node_id), + format!( + "{}:{}", + libpk::config.runtime_config_key.as_ref().unwrap(), + cluster_config().node_id + ), ) .await?, ); diff --git a/crates/libpk/src/_config.rs b/crates/libpk/src/_config.rs index aa6a1f3b..c0f0b65a 100644 --- a/crates/libpk/src/_config.rs +++ b/crates/libpk/src/_config.rs @@ -116,6 +116,9 @@ pub struct PKConfig { #[serde(default = "_json_log_default")] pub(crate) json_log: bool, + #[serde(default)] + pub runtime_config_key: Option, + #[serde(default)] pub sentry_url: Option, }