44a00146aa
We uninstalled Flex, our Elasticsearch gem, to replace item search with direct DB queries; but I forgot these calls, oops! I also kinda want to see about deleting the resque tasks altogether, since I'm not sure how to get Resque installed on latest rails bc there seems to be a conflict over the version of Rack? And it'd be nice to get rid of the complexity if we can.
20 lines
No EOL
415 B
Ruby
20 lines
No EOL
415 B
Ruby
class Item
|
|
class CreateTask
|
|
extend FragmentExpiration
|
|
|
|
TIMEOUT_IN_SECONDS = 10
|
|
|
|
@queue = :item_create
|
|
|
|
def self.perform(id)
|
|
Timeout::timeout(TIMEOUT_IN_SECONDS) do
|
|
expire_newest_items
|
|
end
|
|
end
|
|
|
|
def self.expire_newest_items
|
|
expire_fragment_in_all_locales('outfits#new newest_items')
|
|
expire_fragment_in_all_locales('items#index newest_items')
|
|
end
|
|
end
|
|
end |