Skip to content

Commit

Permalink
If no size is found, something is wrong. GC anyway in 1 minute
Browse files Browse the repository at this point in the history
  • Loading branch information
pintsized committed Jul 15, 2015
1 parent af42fa3 commit 0b92195
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ledge/ledge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,14 @@ function _M.delete_from_cache(self)
local entity_keys = self:cache_entity_keys()
if entity_keys then
-- Set a gc job for the current entity, delayed for current reads
local size = redis:zscore(key_chain.entities, entity_keys.main)
local size, err = redis:zscore(key_chain.entities, entity_keys.main)
if not size or size == ngx_null then
ngx_log(ngx_ERR, err)
-- Something weird has happened with the data structure. Try to clean
-- up in 1 minute.
size = 60
end

self:put_background_job("ledge", "ledge.jobs.collect_entity", {
cache_key_chain = key_chain,
entity_keys = entity_keys,
Expand Down

0 comments on commit 0b92195

Please sign in to comment.