Question

Sometimes running too many servers locally while developing can get out of hand.

How would a Rails app that has Resque (which uses Redis), bypass the need for resque to be running, and just execute the perform method right away?

I want to be able to not have to run those two servers all the time when developing.

Was it helpful?

Solution

Just add this to the bottom of config/environments/development.rb

# bypass resque in the development environment
if Rails.env.development?
    module Resque
        def self.enqueue(klass, *args)
            klass.perform(*args)
        end
    end
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top