Skip to content

Commit 3eadad2

Browse files
committed
set max_attempts to 1 for submit_to_scribd
Change-Id: I02bd7189bf0d6a2c670cf1b6f4f301cf71a97a45 Reviewed-on: https://gerrit.instructure.com/6130 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Zach Wily <zach@instructure.com>
1 parent 611d471 commit 3eadad2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/models/attachment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def touch_context_if_appropriate
9797
# it to scribd from that point does not make the user wait since that
9898
# does happen asynchronously and the data goes directly from s3 to scribd.
9999
def after_attachment_saved
100-
send_later_enqueue_args(:submit_to_scribd!, { :strand => 'scribd' }) unless Attachment.skip_scribd_submits? || !ScribdAPI.enabled?
100+
send_later_enqueue_args(:submit_to_scribd!, { :strand => 'scribd', :max_attempts => 1 }) unless Attachment.skip_scribd_submits? || !ScribdAPI.enabled?
101101
if respond_to?(:process_attachment_with_processing) && thumbnailable? && !attachment_options[:thumbnails].blank? && parent_id.nil?
102102
temp_file = temp_path || create_temp_file
103103
self.class.attachment_options[:thumbnails].each { |suffix, size| send_later_if_production(:create_thumbnail_size, suffix) }

lib/unzip_attachment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def process
162162
Attachment.skip_scribd_submits(false)
163163
FileInContext.queue_files_to_delete(false)
164164
FileInContext.destroy_queued_files
165-
Attachment.send_later(:submit_to_scribd, @attachments.map(&:id))
165+
Attachment.send_later_enqueue_args(:submit_to_scribd, { :strand => 'scribd', :max_attempts => 1 }, @attachments.map(&:id)) unless @attachments.blank?
166166
Course.update_all({:updated_at => Time.now.utc}, {:id => @course.id})
167167
update_progress(1.0)
168168
end

0 commit comments

Comments
 (0)