revert to old catcher for phantomjs for now

This commit is contained in:
Kyle Drake 2015-09-02 17:23:51 -07:00
parent ab6b174ac5
commit 1b6e12a831

View file

@ -5,13 +5,12 @@ require 'thread'
require 'open3' require 'open3'
# Don't judge - Ruby handling of timeouts is a joke.. # Don't judge - Ruby handling of timeouts is a joke..
=begin
module Phantomjs module Phantomjs
def self.run(*args, &block) def self.run(*args, &block)
pid = nil pid = nil
stdin, stdout, stderr, wait_thr = nil stdin, stdout, stderr, wait_thr = nil
begin begin
Timeout::timeout(50) do Timeout::timeout(30) do
stdin, stdout, stderr, wait_thr = Open3.popen3(path, *args) stdin, stdout, stderr, wait_thr = Open3.popen3(path, *args)
pid = wait_thr.pid pid = wait_thr.pid
wait_thr.join wait_thr.join
@ -28,7 +27,6 @@ module Phantomjs
# :nocov: # :nocov:
end end
end end
=end
class ScreenshotWorker class ScreenshotWorker
SCREENSHOTS_PATH = Site::SCREENSHOTS_ROOT SCREENSHOTS_PATH = Site::SCREENSHOTS_ROOT
@ -50,7 +48,7 @@ class ScreenshotWorker
maxRenderWait: 25000, maxRenderWait: 25000,
cutoffWait: 30000 cutoffWait: 30000
) )
rescue => e rescue Timeout::Error
# :nocov: # :nocov:
puts "#{username}/#{path} is timing out, discontinuing" puts "#{username}/#{path} is timing out, discontinuing"
site = Site[username: username] site = Site[username: username]