timeout fixes, UTF8 for templates

This commit is contained in:
Kyle Drake 2013-06-23 18:40:34 -07:00
parent 14480062ba
commit 52713937c5
5 changed files with 10 additions and 3 deletions

View file

@ -34,3 +34,8 @@ task :parse_logs => [:environment] do
end
end
desc 'Update screenshots'
task :update_screenshots => [:environment] do
Site.select(:username).filter(is_banned: false).filter(~{updated_at: nil}).order(:updated_at.desc).all.collect {|s| Backburner.enqueue ScreenshotJob, s.username }
end

View file

@ -49,5 +49,5 @@ end
Backburner.configure do |config|
config.max_job_retries = 3
config.retry_delay = 200
config.respond_timeout = 20
config.respond_timeout = 120
end

View file

@ -15,7 +15,7 @@ class ScreenshotJob
driver = Selenium::WebDriver.for :remote, url: $config['phantomjs_url'][rand($config['phantomjs_url'].length)], desired_capabilities: caps
driver.manage.window.resize_to 1280, 720
wait = Selenium::WebDriver::Wait.new(:timeout => 5) # seconds
wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds
wait.until {
driver.navigate.to "http://#{username}.neocities.org"
driver.save_screenshot screenshot.path

View file

@ -1,6 +1,7 @@
doctype html
html
head
meta charset="utf-8"
title #{template_site_title @site.username} - Front Page
body
p This is a new page! Coming soon.

View file

@ -1,5 +1,6 @@
html
head
meta charset="utf-8"
title #{template_site_title @site.username} - Not Found
body
p The requested page was not found.
p The requested page was not found.