diff --git a/Gemfile b/Gemfile index dcaf606a..776cf26b 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ gem 'google-api-client', require: 'google/api_client' gem 'tilt' gem 'erubis' gem 'stripe' #, source: 'https://code.stripe.com/' -gem 'screencap' +gem 'screencap', '~> 0.1.4' gem 'cocaine' gem 'zipruby' gem 'sass', require: nil diff --git a/Gemfile.lock b/Gemfile.lock index 8ec16f93..6e10420f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -125,7 +125,7 @@ GEM nokogiri (1.6.6.2) mini_portile (~> 0.6.0) pg (0.17.1) - phantomjs (1.9.7.1) + phantomjs (1.9.8.0) poltergeist (1.6.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -180,7 +180,7 @@ GEM sysinfo (>= 0.8.1) safe_yaml (1.0.4) sass (3.3.8) - screencap (0.1.1) + screencap (0.1.4) phantomjs scrypt (2.0.0) ffi-compiler (>= 0.0.2) @@ -300,7 +300,7 @@ DEPENDENCIES ruby-debug rye sass - screencap + screencap (~> 0.1.4) scrypt sequel (= 4.8.0) sequel_pg diff --git a/workers/screenshot_worker.rb b/workers/screenshot_worker.rb index 8831a1d4..1ddf3567 100644 --- a/workers/screenshot_worker.rb +++ b/workers/screenshot_worker.rb @@ -5,6 +5,7 @@ require 'thread' require 'open3' # Don't judge - Ruby handling of timeouts is a joke.. +=begin module Phantomjs def self.run(*args, &block) pid = nil @@ -27,6 +28,7 @@ module Phantomjs # :nocov: end end +=end class ScreenshotWorker SCREENSHOTS_PATH = Site::SCREENSHOTS_ROOT @@ -44,9 +46,11 @@ class ScreenshotWorker f.fetch( output: screenshot_output_path, width: 1280, - height: 960 + height: 960, + maxRenderWait: 25000, + cutoffWait: 30000 ) - rescue Timeout::Error + rescue => e # :nocov: puts "#{username}/#{path} is timing out, discontinuing" site = Site[username: username]