Commit 550d8911 authored by amir.yosef's avatar amir.yosef

Updating SET command args checking

parent 30c1e7c6
......@@ -31,12 +31,8 @@ public class SetCommand implements CommandExecutable<byte[]> {
String value = args.get(1);
String expiration = commandsMap.get(Command.PX.getValue().toLowerCase());
if (expiration != null) {
try {
Long expirationTime = Long.parseLong(expiration);
storage.save(args.getFirst().toLowerCase(), value, expirationTime);
} catch (NumberFormatException e) {
System.out.println("NumberFormatException: " + e.getMessage());
}
} else {
storage.save(args.getFirst().toLowerCase(), value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment