Error when removing queue #8

Closed
rkistner opened this Issue Jun 13, 2011 · 3 comments

Comments

Projects
None yet
2 participants

When I remove a queue without any scheduled jobs, I get the following error:

RuntimeError: ERR wrong number of arguments for 'del' command
    redis (2.2.0) lib/redis/client.rb:39:in `call'
    redis (2.2.0) lib/redis.rb:674:in `block in del'
    /usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    redis (2.2.0) lib/redis.rb:673:in `del'
    /usr/local/lib/ruby/gems/1.9.1/gems/redis-namespace-1.0.3/lib/redis/namespace.rb:213:in `method_missing'
    /usr/local/lib/ruby/gems/1.9.1/gems/resque-loner-0.1.3/lib/resque-loner/helpers.rb:54:in `cleanup_loners'
    /usr/local/lib/ruby/gems/1.9.1/gems/resque-loner-0.1.3/lib/resque-ext/resque.rb:26:in `remove_queue_with_loner_cleanup'

This is with resque-loner 0.1.3, Resque 1.16.1 and Redis gem 2.2.0.

The following monkey-patch solves the issue for me:

module Resque
  module Plugins
    module Loner
      class Helpers
        def self.cleanup_loners(queue)
          keys = redis.keys("loners:queue:#{queue}:job:*")
          redis.del(*keys) unless keys.empty?
        end
      end
    end
  end
end
Contributor

jayniz commented Jun 13, 2011

thanks, can i pull from somewhere?

I haven't branched it or written any tests, but it's only the small
modification in the method I pasted.

On Mon, Jun 13, 2011 at 7:58 PM, jayniz <
reply@reply.github.com>wrote:

thanks, can i pull from somewhere?

Reply to this email directly or view it on GitHub:
jayniz#8 (comment)

Contributor

jayniz commented Jul 15, 2011

closed in pull request #9

@jayniz jayniz closed this Jul 15, 2011

jayniz added a commit that referenced this issue Jul 15, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment