开发者

resque-meta and multiple arguments in ruby

开发者 https://www.devze.com 2023-03-24 06:35 出处:网络
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,

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_herok开发者_StackOverflow中文版u_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
0

精彩评论

暂无评论...
验证码 换一张
取 消