Permalink
Browse files

cleanup AR driver

  • Loading branch information...
1 parent 522d95f commit b53d6879347be51fa0f450fc189b31083d507e42 @igrigorik committed Jun 19, 2010
Showing with 4 additions and 6 deletions.
  1. +3 −5 lib/active_record/connection_adapters/em_mysqlplus_adapter.rb
  2. +1 −1 lib/active_record/patches.rb
@@ -1,14 +1,12 @@
-gem 'activerecord', '>= 2.3.4'
+require 'em-synchrony'
+require 'em-synchrony/em-mysqlplus'
-require 'activerecord'
require 'active_record/connection_adapters/mysql_adapter'
-require 'em-synchrony'
module ActiveRecord
module ConnectionAdapters
class EmMysqlAdapter < MysqlAdapter
-
def initialize(connection, logger, host_parameters, connection_parameters, config)
@hostname = host_parameters[0]
@port = host_parameters[1]
@@ -49,4 +47,4 @@ def self.em_mysqlplus_connection(config) # :nodoc:
ConnectionAdapters::EmMysqlAdapter.new(nil, logger, [host, port], [database, username, password], config)
end
end
-end
+end
@@ -82,7 +82,7 @@ def remove_stale_cached_threads!(cache, &block)
keys.delete(object_id)
end
end
-# puts "Pruning stale connections: #{f.busy_fibers.size} #{f.fibers.size} #{keys.inspect}"
+
keys.each do |key|
next unless cache.has_key?(key)
block.call(key, cache[key])

0 comments on commit b53d687

Please sign in to comment.