diff --git a/app/models/map.rb b/app/models/map.rb index 91bc0a11..b5a6de09 100644 --- a/app/models/map.rb +++ b/app/models/map.rb @@ -8,8 +8,6 @@ class Map < ActiveRecord::Base has_many :topics, :through => :topicmappings has_many :synapses, :through => :synapsemappings - #after_touch :save_screenshot - # This method associates the attribute ":image" with a file attachment has_attached_file :screenshot, :styles => { :thumb => ['188x126#', :png] @@ -121,17 +119,6 @@ class Map < ActiveRecord::Base return true end - def save_screenshot - # TODO - this will grab a map every single frickin' time a map is touched - # we need a system to throttle the amount to 1/hour or something like that - # maybe have a flag - last time this map was screenshotted - # don't update if it was less than an hour ago - # except this has the issue of a user updating map 7x, and it only screenshotting after - # the first time. We only want it to screenhsot the 7th time. - # We need to store a timestamp somewhere and do processing every hour, I think. - GrabMapScreenshotWorker.perform_async(self.id) - end - def decode_base64(imgBase64) decoded_data = Base64.decode64(imgBase64) diff --git a/app/workers/grab_map_screenshot_worker.rb b/app/workers/grab_map_screenshot_worker.rb deleted file mode 100644 index b3d97e4f..00000000 --- a/app/workers/grab_map_screenshot_worker.rb +++ /dev/null @@ -1,10 +0,0 @@ -# app/workers/grab_map_screenshot_worker.rb -class GrabMapScreenshotWorker - include Sidekiq::Worker - - def perform(map_id) - imgBase64 = `phantomjs ./script/phantomjs-save-screenshot.js #{map_id} #{Rails.env}` - map = Map.find(map_id) - map.decode_base64(imgBase64) - end -end