mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
timeout fixes, UTF8 for templates
This commit is contained in:
parent
14480062ba
commit
52713937c5
5 changed files with 10 additions and 3 deletions
5
Rakefile
5
Rakefile
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue