This commit is contained in:
2025-08-16 08:25:25 +02:00
parent 0f6e595000
commit 7bcb673361
15 changed files with 522 additions and 388 deletions

View File

@@ -18,6 +18,10 @@ struct Args {
/// The port of the Redis server, default is 6379 if not specified
#[arg(long)]
port: Option<u16>,
/// Enable debug mode
#[arg(long)]
debug: bool,
}
#[tokio::main]
@@ -36,11 +40,15 @@ async fn main() {
let option = redis_rs::options::DBOption {
dir: args.dir,
port,
debug: args.debug,
};
// new server
let server = server::Server::new(option).await;
// Add a small delay to ensure the port is ready
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
// accept new connections
loop {
let stream = listener.accept().await;