1
0
Fork 0
forked from OpenNeo/impress
impress/app/models/item/update_task.rb
Matchu beb5c14d42 Simplify item page rendering
Just removing some caching and the expiration of it! There's still more superfluous(?) caching on the item page to audit, but these seem a bit more sensible about avoiding loading extra data.
2023-08-02 11:38:10 -07:00

22 lines
No EOL
397 B
Ruby

class Item
class UpdateTask
extend FragmentExpiration
TIMEOUT_IN_SECONDS = 10
@queue = :item_update
def self.perform(id)
Timeout::timeout(TIMEOUT_IN_SECONDS) do
item = Item.find(id)
expire_cache_for(item)
end
end
private
def self.expire_cache_for(item)
expire_key_in_all_locales("items/#{item.id}#as_json")
end
end
end