aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authoromagdy <omar.professional8777@gmail.com>2025-07-23 01:11:12 +0300
committeromagdy <omar.professional8777@gmail.com>2025-07-23 01:11:12 +0300
commitc94f86353dd98a176b61806eb4f25c9170c26717 (patch)
tree8425cb5ed8733a979aa3618fea8fc9bb957aedc3 /src/main.rs
parent7dbaa99eb721748f5eff2839817c6742029ad2b3 (diff)
downloadredis-rust-c94f86353dd98a176b61806eb4f25c9170c26717.tar.xz
redis-rust-c94f86353dd98a176b61806eb4f25c9170c26717.zip
feat: Added simple logic to check if redis node role is master or slave
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 5fdd6c3..3186b6c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -67,7 +67,8 @@ fn main() -> std::io::Result<()> {
let mut cache = cache.lock().unwrap();
let dir = conf.dir.clone().unwrap_or("".to_string());
let dbfilename = conf.dbfilename.clone().unwrap_or("".to_string());
- port = conf.port.clone().unwrap_or("6379".to_string());
+ let redis_server = conf.server.clone();
+ port = redis_server.port.clone();
if let Ok(rdb_file) = RDBFile::read(dir, dbfilename) {
if let Some(rdb) = rdb_file {
let hash_table = &rdb.databases.get(&0).unwrap().hash_table;