mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
fix for screenshot worker test
This commit is contained in:
parent
a0b3216ec8
commit
28ed2718ba
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ class ScreenshotWorker
|
||||||
base_image_tmpfile_path = "/tmp/#{SecureRandom.uuid}.png"
|
base_image_tmpfile_path = "/tmp/#{SecureRandom.uuid}.png"
|
||||||
|
|
||||||
http_resp = HTTP.basic_auth(user: api_user, pass: api_password).get(uri)
|
http_resp = HTTP.basic_auth(user: api_user, pass: api_password).get(uri)
|
||||||
BlackBox.new(site, path).check_uri(http_resp.headers['X-URL'])
|
BlackBox.new(site, path).check_uri(http_resp.headers['X-URL']) if defined?(BlackBox)
|
||||||
File.write base_image_tmpfile_path, http_resp.to_s
|
File.write base_image_tmpfile_path, http_resp.to_s
|
||||||
|
|
||||||
user_screenshots_path = File.join SCREENSHOTS_PATH, Site.sharding_dir(username), username
|
user_screenshots_path = File.join SCREENSHOTS_PATH, Site.sharding_dir(username), username
|
||||||
|
@ -72,7 +72,7 @@ class ScreenshotWorker
|
||||||
rescue => e
|
rescue => e
|
||||||
raise e
|
raise e
|
||||||
ensure
|
ensure
|
||||||
FileUtils.rm base_image_tmpfile_path
|
FileUtils.rm base_image_tmpfile_path if File.exist?(base_image_tmpfile_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue