Fix. Not found is treat as success for delete operation.

This commit is contained in:
Alexey Melnichuk
2015-09-09 16:52:52 +04:00
parent 528d04b942
commit dcc08a2265

View File

@@ -56,7 +56,12 @@ end
function Cache.del(key)
local result, err = check_error(api:execute("memcache", "set " .. key .. " '" .. value .. "' " .. expire))
if not result then return nil, err end
if not result then
if err == 'NOT FOUND' then
return true
end
return nil, err
end
return result == '+OK'
end