diff --git a/lib/api/environment.rb b/lib/api/environment.rb index 87b34f99ee..eae6fbeed6 100644 --- a/lib/api/environment.rb +++ b/lib/api/environment.rb @@ -19,8 +19,8 @@ def self.time_attributes next if cspec[:klass].blank? klass = nil - # Temporary measure to avoid thread race condition which could lead to a deadlock - ActiveSupport::Dependencies.interlock.permit_concurrent_loads do + # Ensure we're the only thread trying to autoload classes and their columns + ActiveSupport::Dependencies.interlock.loading do klass = cspec[:klass].constantize end klass.columns_hash.each do |name, typeobj|