0
我收到以下錯誤信息:Sidekiq和Twilio在工人打破「錯誤的參數數目(1 2)」
WARN: wrong number of arguments (1 for 2)
我已經使用了很多binding.pry
和boilded下來打破權之前或期間def perform
。如果我在def perform
內部立即插入binding.pry
它不會運行binding.pry
,所以它可能與我的def執行有關?我正在使用的代碼如下。
裏面的工人的:
class MessageWorker
include Sidekiq::Worker
sidekiq_options retry: false
sidekiq_retries_exhausted do |msg|
Sidekiq.logger.warn "Failed #{msg['class']} with #{msg['args']}: #{msg['error_message']}."
end
def perform(send_time, message_id)
record = Textmessage.find message_id
@twilio = Twilio::REST::Client.new ENV['ACCOUNT_SID'], ENV['AUTH_TOKEN']
@twilio.account.messages.create(
from: ENV['ACCOUNT_PHONE_NUMBER'],
to: record.phone_number,
body: 'Reminder'
)
end
end