2014-10-07 23:11:55 +00:00
|
|
|
# app/workers/grab_map_screenshot_worker.rb
|
|
|
|
class GrabMapScreenshotWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
def perform(map_id)
|
2014-10-11 01:24:31 +00:00
|
|
|
imgBase64 = `phantomjs ./script/phantomjs-save-screenshot.js #{map_id} #{Rails.env}`
|
2014-10-08 04:07:54 +00:00
|
|
|
map = Map.find(map_id)
|
|
|
|
map.decode_base64(imgBase64)
|
2014-10-07 23:11:55 +00:00
|
|
|
end
|
|
|
|
end
|