...
This commit is contained in:
		| @@ -673,18 +673,22 @@ async fn keys_cmd(server: &Server) -> Result<Protocol, DBError> { | ||||
| struct ServerInfo { | ||||
|     redis_version: String, | ||||
|     encrypted: bool, | ||||
|     selected_db: u64, | ||||
| } | ||||
|  | ||||
| async fn info_cmd(server: &Server, section: &Option<String>) -> Result<Protocol, DBError> { | ||||
|     let info = ServerInfo { | ||||
|         redis_version: "7.0.0".to_string(), | ||||
|         encrypted: server.current_storage()?.is_encrypted(), | ||||
|         selected_db: server.selected_db, | ||||
|     }; | ||||
|  | ||||
|     let mut info_string = String::new(); | ||||
|     info_string.push_str(&format!("# Server\n")); | ||||
|     info_string.push_str(&format!("redis_version:{}\n", info.redis_version)); | ||||
|     info_string.push_str(&format!("encrypted:{}\n", if info.encrypted { 1 } else { 0 })); | ||||
|     info_string.push_str(&format!("# Keyspace\n")); | ||||
|     info_string.push_str(&format!("db{}:keys=0,expires=0,avg_ttl=0\n", info.selected_db)); | ||||
|  | ||||
|  | ||||
|     match section { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user