I am using Resque and I have a Redis queue.It has certain duplicate entries. I need to remove the duplicate entires.How do I remove those duplicate entries? I am enqueuing the id of a certain object.
我正在使用Resque,我有一个Redis队列。它有一定的重复条目。我需要删除重复的实体。如何删除重复的条目?我正在排队某个对象的id。
1 个解决方案
#1
6
Look into the resque-loner gem. It allows you to make job queues unique. All you do is include Resque::Plugins::UniqueJob in the job classes you you to make unique.
看看这颗孤独的宝石。它允许使作业队列惟一。你所要做的就是将Resque: Plugins::UniqueJob加入到你要制作的职业类中。
class CacheSweeper
include Resque::Plugins::UniqueJob
class << self
def perform(project_name)
# some code
end
end
end
#1
6
Look into the resque-loner gem. It allows you to make job queues unique. All you do is include Resque::Plugins::UniqueJob in the job classes you you to make unique.
看看这颗孤独的宝石。它允许使作业队列惟一。你所要做的就是将Resque: Plugins::UniqueJob加入到你要制作的职业类中。
class CacheSweeper
include Resque::Plugins::UniqueJob
class << self
def perform(project_name)
# some code
end
end
end