Created
April 8, 2010 18:43
-
-
Save cluesque/360382 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Include this in your development and test environments | |
| # if you want to run all Resque processors inline | |
| # (avoiding the need for Redis and a separate worker process) | |
| # In config/environments/{development,test}.rb: | |
| # config.after_initialize do | |
| # require 'resque_inline' | |
| # end | |
| module Resque | |
| def enqueue_with_environment_checking(klass, *args) | |
| if ENV['USE_REDIS'].blank? | |
| klass.perform(*args) | |
| "OK" | |
| else | |
| enqueue_without_environment_checking(klass, *args) | |
| end | |
| end | |
| class << self | |
| alias_method_chain :enqueue, :environment_checking | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment