-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap Terminator
in a helper called timeout_helper
#12
Conversation
This reverts commit e363f6f.
This module is to be used to wrap the Terminator gem Also logs errors to the console
end | ||
# try with ghostscript | ||
did_compress = false | ||
try_within 120, "compressing image" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change these to the newer shorter times... 2 minutes ended up being too much here. 40 sec now... though I think it will be less later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing 😊 sorry must've missed the new values
Sent from my iPhone
On 11 Apr 2016, at 4:39 PM, Andrew Cain notifications@github.com wrote:
In app/helpers/file_helper.rb:
@@ -187,11 +187,11 @@ def compress_image(path)
exec = "#{Rails.root.join('lib', 'shell', 'timeout.sh')} -t 30 nice -n 10 convert "#{path}" -resize 1024x1024 "#{tmp_file}" >>/dev/null 2>>/dev/null"
# puts exec
# try with convert
did_compress = false
Terminator.terminate 40 do
did_compress = system exec
end
try with ghostscript
- did_compress = false
- try_within 120, "compressing image" do
Could you change these to the newer shorter times... 2 minutes ended up being too much here. 40 sec now... though I think it will be less later.—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
Provides a more descriptive way of using
Terminator
's that will rescue with an optional message if timeout occurs. This means more descriptive messages can be responded back to users (was getting "Invalid document provided" now we can get "Server couldn't validate pdf due to timeout")