mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
update phantomjs and screencap
This commit is contained in:
parent
233265f8ab
commit
91640d87b6
3 changed files with 10 additions and 6 deletions
2
Gemfile
2
Gemfile
|
@ -16,7 +16,7 @@ gem 'google-api-client', require: 'google/api_client'
|
||||||
gem 'tilt'
|
gem 'tilt'
|
||||||
gem 'erubis'
|
gem 'erubis'
|
||||||
gem 'stripe' #, source: 'https://code.stripe.com/'
|
gem 'stripe' #, source: 'https://code.stripe.com/'
|
||||||
gem 'screencap'
|
gem 'screencap', '~> 0.1.4'
|
||||||
gem 'cocaine'
|
gem 'cocaine'
|
||||||
gem 'zipruby'
|
gem 'zipruby'
|
||||||
gem 'sass', require: nil
|
gem 'sass', require: nil
|
||||||
|
|
|
@ -125,7 +125,7 @@ GEM
|
||||||
nokogiri (1.6.6.2)
|
nokogiri (1.6.6.2)
|
||||||
mini_portile (~> 0.6.0)
|
mini_portile (~> 0.6.0)
|
||||||
pg (0.17.1)
|
pg (0.17.1)
|
||||||
phantomjs (1.9.7.1)
|
phantomjs (1.9.8.0)
|
||||||
poltergeist (1.6.0)
|
poltergeist (1.6.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
|
@ -180,7 +180,7 @@ GEM
|
||||||
sysinfo (>= 0.8.1)
|
sysinfo (>= 0.8.1)
|
||||||
safe_yaml (1.0.4)
|
safe_yaml (1.0.4)
|
||||||
sass (3.3.8)
|
sass (3.3.8)
|
||||||
screencap (0.1.1)
|
screencap (0.1.4)
|
||||||
phantomjs
|
phantomjs
|
||||||
scrypt (2.0.0)
|
scrypt (2.0.0)
|
||||||
ffi-compiler (>= 0.0.2)
|
ffi-compiler (>= 0.0.2)
|
||||||
|
@ -300,7 +300,7 @@ DEPENDENCIES
|
||||||
ruby-debug
|
ruby-debug
|
||||||
rye
|
rye
|
||||||
sass
|
sass
|
||||||
screencap
|
screencap (~> 0.1.4)
|
||||||
scrypt
|
scrypt
|
||||||
sequel (= 4.8.0)
|
sequel (= 4.8.0)
|
||||||
sequel_pg
|
sequel_pg
|
||||||
|
|
|
@ -5,6 +5,7 @@ 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
|
||||||
|
@ -27,6 +28,7 @@ module Phantomjs
|
||||||
# :nocov:
|
# :nocov:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
=end
|
||||||
|
|
||||||
class ScreenshotWorker
|
class ScreenshotWorker
|
||||||
SCREENSHOTS_PATH = Site::SCREENSHOTS_ROOT
|
SCREENSHOTS_PATH = Site::SCREENSHOTS_ROOT
|
||||||
|
@ -44,9 +46,11 @@ class ScreenshotWorker
|
||||||
f.fetch(
|
f.fetch(
|
||||||
output: screenshot_output_path,
|
output: screenshot_output_path,
|
||||||
width: 1280,
|
width: 1280,
|
||||||
height: 960
|
height: 960,
|
||||||
|
maxRenderWait: 25000,
|
||||||
|
cutoffWait: 30000
|
||||||
)
|
)
|
||||||
rescue Timeout::Error
|
rescue => e
|
||||||
# :nocov:
|
# :nocov:
|
||||||
puts "#{username}/#{path} is timing out, discontinuing"
|
puts "#{username}/#{path} is timing out, discontinuing"
|
||||||
site = Site[username: username]
|
site = Site[username: username]
|
||||||
|
|
Loading…
Add table
Reference in a new issue