Yeah, I know you can set the namespace to whatever you want, but I was
reasonably sure that as long as you use "Resque.redis" you would at least
see consistent namespaced or non-namespaced behavior. It's unfortunate that
the "resque-scheduler" isn't using the namespaced client (I think it should
be). But that's not a problem I expect to solve here.

What you have is fine, perhaps you can simplify the adding of the two
arrays using "reduce" or "inject". Something like:

%w[delayed_queue_schedule resque:delayed_queue_schedule].reduce([]) {
|memo, key| memo += Resque.redis.zrange(key, 0, -1) }

Not sure that it's actually better.. I dunno, just trying to minimize
repetition. Some version of my suggestion could also be wrapped up into a
helper.

Either way, I wouldn't hold up the merge for this as long as it's clearly
commented.


On Tue, May 13, 2014 at 10:55 AM, David Copeland
<notifications@github.com>wrote:

> In test/test_helper.rb:
>
> > +    worker.working_on job
> > +
> > +    # Similar to resque's Worker.work and Worker.process methods
> > +    begin
> > +      raise 'error from perform_next_job_fail_on_reconnect'
> > +      worker.perform(job, &block)
> > +    rescue Exception => exception
> > +      worker.report_failed_job(job,exception)
> > +    ensure
> > +      worker.done_working
> > +    end
> > +  end
> > +
> > +  def delayed_jobs
> > +    # The double-checks here are so that we won't blow up if the config stops using redis-namespace
> > +    timestamps = (Resque.redis.zrange("resque:delayed_queue_schedule",0,-1) +
>
> remove the un-namespaced version causes the tests to fail. Whatever's
> going on in the tests with resque-scheduler puts the jobs in the "naked"
> key, and not the namespaced one. I saw this locally which is why it's here.
> FWIW, resque doesn't really guarantee that the redis instance is
> namespaced—you can set it to whatever you want.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/lantins/resque-retry/pull/100/files#r12587400>
> .
>