Created
March 4, 2011 01:07
-
-
Save choonkeat/853958 to your computer and use it in GitHub Desktop.
making delayed_job perform synchronously in development
This file contains 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
# inside config/environment.rb | |
if Rails.env == 'development' | |
Rails.logger.info "Delayed::Job is executed synchronously in #{Rails.env} mode." | |
Delayed::Job.class_eval do | |
def self.enqueue(obj) | |
Rails.logger.info "Delayed::Job:SYNC START" | |
obj.perform | |
Rails.logger.info "Delayed::Job:SYNC END" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To make it work with collectiveidea/delayed_job version 2.1.4 I changed line 7 with