Module | Sequel::ServerLogging |
In: |
lib/sequel/extensions/server_logging.rb
|
Initialize the hash mapping connections to shards, and turn on logging of connection info unless it has specifically been turned off.
# File lib/sequel/extensions/server_logging.rb, line 30 30: def self.extended(db) 31: db.instance_exec do 32: @server_connection_map ||= {} 33: self.log_connection_info = true if log_connection_info.nil? 34: end 35: end
When setting up a new connection, associate the connection with the shard.
# File lib/sequel/extensions/server_logging.rb, line 39 39: def connect(server) 40: conn = super 41: Sequel.synchronize{@server_connection_map[conn] = server} 42: conn 43: end