Skip to content

Commit 477bc6c

Browse files
committed
Set open timeout and read timeout on sandbox post
1 parent fecb289 commit 477bc6c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/models/remote_sandbox.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def send_submission(submission, notify_url)
5656
SubmissionPackager.get(exercise).package_submission(exercise, zip_path, tar_path, submission.params)
5757

5858
File.open(tar_path, 'r') do |tar_file|
59-
RestClient.post post_url, file: tar_file, notify: notify_url, token: submission.secret_token
59+
Rails.logger.info "Posting submission to #{post_url}"
60+
RestClient::Request.execute(method: :post, url: post_url, timeout: 5, payload: {
61+
file: tar_file, notify: notify_url, token: submission.secret_token
62+
})
6063
submission.sandbox = post_url
6164
submission.save!
6265
rescue StandardError => e

0 commit comments

Comments
 (0)