ruby 中的 resque-meta 和多个参数
我最近改用 Resque-meta ,现在我对如何最好地处理感到有点困惑多个参数。我将它作为第一个 ID 传递,但是使用元插件,元 id 变成了 ID,并且它崩溃了。
c=MessifyAsync.enqueue(5094, Date.today)
现在它显示第一个 ID 作为元标记
["0cb5843267d5eaef77eaf770ece86bb2850f46bc", 5094, "2011-07-29"]
代码:
require 'resque/plugins/resque_heroku_autoscaler'
require 'resque-meta'
class MessifyAsync
extend Resque::Plugins::HerokuAutoscaler
extend Resque::Plugins::Meta
@queue = :messify
def self.perform(space_id, date = Date.today+7.days)
Available.messify(:id => space_id, :date => date)
end
end
I recently switched to using Resque-meta and now I'm a bit confused with how best to handle multiple arguments. I was passing it as the first ID, but using the meta plugin, the meta id becomes the ID, and it breaks.
c=MessifyAsync.enqueue(5094, Date.today)
Now it shows the first ID as meta stamp
["0cb5843267d5eaef77eaf770ece86bb2850f46bc", 5094, "2011-07-29"]
Code:
require 'resque/plugins/resque_heroku_autoscaler'
require 'resque-meta'
class MessifyAsync
extend Resque::Plugins::HerokuAutoscaler
extend Resque::Plugins::Meta
@queue = :messify
def self.perform(space_id, date = Date.today+7.days)
Available.messify(:id => space_id, :date => date)
end
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论