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
1 changed files with 6 additions and 1 deletions

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