2012-02-10 82 views

回答

6

看看resque-loner寶石。它可以讓你的工作隊列獨特。你所要做的就是在你要做的獨特工作類中加入Resque :: Plugins :: UniqueJob。

class CacheSweeper 
    include Resque::Plugins::UniqueJob 


    class << self 
    def perform(project_name) 
     # some code 
    end 
    end 
end