server: implement key expiration (#13)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::cmd::{Parse, ParseError};
|
||||
use crate::{Connection, Frame, Kv};
|
||||
use crate::{Connection, Frame, Db};
|
||||
|
||||
use bytes::Bytes;
|
||||
use std::io;
|
||||
@@ -42,9 +42,9 @@ impl Set {
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
pub(crate) async fn apply(self, kv: &Kv, dst: &mut Connection) -> io::Result<()> {
|
||||
pub(crate) async fn apply(self, db: &Db, dst: &mut Connection) -> io::Result<()> {
|
||||
// Set the value
|
||||
kv.set(self.key, self.value, self.expire);
|
||||
db.set(self.key, self.value, self.expire);
|
||||
|
||||
let response = Frame::Simple("OK".to_string());
|
||||
debug!(?response);
|
||||
|
||||
Reference in New Issue
Block a user