Skip to content
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

Merged
merged 10 commits into from Apr 12, 2016
Merged

Wrap Terminator in a helper called timeout_helper #12

merged 10 commits into from Apr 12, 2016

Conversation

alexcu
Copy link
Contributor

@alexcu alexcu commented Apr 11, 2016

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")

end
# try with ghostscript
did_compress = false
try_within 120, "compressing image" do
Copy link
Member

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.

Copy link
Contributor Author

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

@macite macite merged commit eefa808 into doubtfire-lms:develop Apr 12, 2016
@alexcu alexcu deleted the quality/add-timeout-helper branch May 1, 2016 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants