impress/app/models/outfit_image_update.rb

22 lines
530 B
Ruby
Raw Normal View History

2012-11-04 10:01:03 -08:00
require 'timeout'
2012-07-16 13:47:28 -07:00
class OutfitImageUpdate
2012-11-04 10:01:03 -08:00
TIMEOUT_IN_SECONDS = 30
2012-07-16 13:47:28 -07:00
@queue = :outfit_image_updates
def self.perform(id)
2012-11-04 10:01:03 -08:00
Timeout::timeout(TIMEOUT_IN_SECONDS) do
Outfit.find(id).write_image!
end
2012-07-16 13:47:28 -07:00
end
2012-07-31 07:20:37 -07:00
# Represents an outfit image update for an outfit that existed before this
# feature was built. Its queue has a lower priority, so new outfits will
# be updated before retroactively converted outfits.
class Retroactive < OutfitImageUpdate
@queue = :retroactive_outfit_image_updates
end
2012-07-16 13:47:28 -07:00
end