changeset 50:86948069ef60

Enables thread safety.
author Edho Arief <edho@myconan.net>
date Thu, 04 Oct 2012 03:43:40 +0700
parents c09020fc73f5
children 4c782f8d835b
files config/application.rb
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/config/application.rb	Thu Oct 04 03:08:00 2012 +0700
+++ b/config/application.rb	Thu Oct 04 03:43:40 2012 +0700
@@ -24,6 +24,10 @@
     # Custom directories with classes and modules you want to be autoloadable.
     # config.autoload_paths += %W(#{config.root}/extras)
 
+    # Enable threaded mode except for rake tasks as it doesn't work quite well
+    # Reference: http://groups.google.com/group/rubyonrails-core/browse_thread/thread/b13dbe0b8f12b7dc
+    config.threadsafe! unless $rails_rake_task
+
     # Only load the plugins named here, in the order given (default is alphabetical).
     # :all can be used as a placeholder for all plugins not explicitly named.
     # config.plugins = [ :exception_notification, :ssl_requirement, :all ]