Implemented EXPIRTE and PEXPIRE command handler

This commit is contained in:
Kelvin Mwinuka
2024-03-09 23:28:46 +08:00
parent b7b8ecff4c
commit 97a10e4fdb
2 changed files with 68 additions and 4 deletions

View File

@@ -68,14 +68,14 @@ func ttlKeyFunc(cmd []string) ([]string, error) {
}
func expireKeyFunc(cmd []string) ([]string, error) {
if len(cmd) != 4 {
if len(cmd) < 3 || len(cmd) > 4 {
return nil, errors.New(utils.WrongArgsResponse)
}
return []string{cmd[1]}, nil
}
func expireAtKeyFunc(cmd []string) ([]string, error) {
if len(cmd) != 4 {
if len(cmd) < 3 || len(cmd) > 4 {
return nil, errors.New(utils.WrongArgsResponse)
}
return []string{cmd[1]}, nil