You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lrucache:set(key, value, ttl, flags) os.execute("sleep " .. tonumber(ttl+2)) local data, stale_data, flags = lrucache:get(key)
data is not nil
lruchache' get method if node.expire >= 0 and node.expire < ngx_now() then return nil, val, node.user_flags end
ngx_now() Returns a floating-point number for the elapsed time in seconds (including milliseconds as the decimal part) from the epoch for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library). https://github.com/openresty/lua-nginx-module#ngxnow
Is it better to add an ngx.update_time()?
The text was updated successfully, but these errors were encountered:
Mhaoyuan
changed the title
BUF
BUG: The expiration time may not take effect
Dec 25, 2020
lrucache:set(key, value, ttl, flags)
os.execute("sleep " .. tonumber(ttl+2))
local data, stale_data, flags = lrucache:get(key)
data is not nil
lruchache' get method
if node.expire >= 0 and node.expire < ngx_now() then
return nil, val, node.user_flags
end
ngx_now() Returns a floating-point number for the elapsed time in seconds (including milliseconds as the decimal part) from the epoch for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library). https://github.com/openresty/lua-nginx-module#ngxnow
Is it better to add an ngx.update_time()?
The text was updated successfully, but these errors were encountered: