1
0
Fork 0
forked from OpenNeo/impress
impress/app/models/item/destroy_task.rb

17 lines
354 B
Ruby
Raw Normal View History

class Item
class DestroyTask
extend FragmentExpiration
TIMEOUT_IN_SECONDS = 10
@queue = :item_destroy
def self.perform(id)
Timeout::timeout(TIMEOUT_IN_SECONDS) do
Item.find(id).flex.sync
# TODO: it's kinda ugly to reach across classes like this
CreateTask.expire_newest_items
end
end
end
end