如何停止延迟作业以执行重复记录

时间:2015-12-27 18:38:25

标签: delayed-job ruby-on-rails-2

  counter.times do
              count_var+= 1
              range1 = process_limit * count_var
              sms = Delayed::Job.enqueue(SmsManager.new(arr_msg_array[i1...range1], recipients[i1...range1], student_type[i1...range1], reciver_type[i1...range1], reciver_id[i1...range1], created_by[i1...range1])) i1= range1
            end


----------   


 class SmsManager
  attr_accessor :recipients, :message, :astudent_type, :areciver_type, :areciver_id, :acreated_by

def initialize(message,recipients,student_type,caregiver_type,receiver_id,created_by) 端

      def perform
          begin
            recipients.each_with_index do |recipient,i|                
            end
              end
            end
            end

1 个答案:

答案 0 :(得分:1)

在每个失败作业中,延迟处理程序尝试根据定义的重新尝试次数重新执行整个作业数组。