class SendPostWorker
@queue = :send_post_worker
def self.perform(post_id, group_id)
group = Group.find(group_id.to_i)
::BotMessageDispatcher.new(group, post_id).work
end
end
class PostsController < ApplicationController
def create
# Code
Resque.enqueue_in(@post.scheduled_time - Time.now, SendPostWorker, @post.id, params['groups']['group'].to_i)
# Code
end
end
ArgumentError
Error
wrong number of arguments (given 2, expected 1)
/Users/Lois/Desktop/projects/bot/app/workers/send_post_worker.rb:4:in `perform'
提前感谢您的帮助〜!
答案 0 :(得分:0)
所以我在与同事交谈后解决了这个问题。张贴给未来的读者。
在对resque工作者进行更改后重新启动它们。