[ap4r-devel] [250] trunk/ap4r/lib/ap4r/message_store_ext.rb: Modified order of create connection to PostgreSQL, native library is first and pure ruby library is second.
kato-k at rubyforge.org
kato-k at rubyforge.org
Fri Aug 10 00:30:04 EDT 2007
Revision: 250
Author: kato-k
Date: 2007-08-10 00:30:04 -0400 (Fri, 10 Aug 2007)
Log Message:
-----------
Modified order of create connection to PostgreSQL, native library is first and pure ruby library is second.
Modified Paths:
--------------
trunk/ap4r/lib/ap4r/message_store_ext.rb
Modified: trunk/ap4r/lib/ap4r/message_store_ext.rb
===================================================================
--- trunk/ap4r/lib/ap4r/message_store_ext.rb 2007-08-07 12:14:53 UTC (rev 249)
+++ trunk/ap4r/lib/ap4r/message_store_ext.rb 2007-08-10 04:30:04 UTC (rev 250)
@@ -195,10 +195,10 @@
# Thread.current[THREAD_CURRENT_PGSQL] ||= ::PostgresPR::Connection.new @config[:host], @config[:username], @config[:password], at config[:database], @config[:port], @config[:socket]
Thread.current[THREAD_CURRENT_PGSQL] ||=
- if $:.any?{ |e| e.include?('postgres-pr') }
+ if $:.any?{ |e| e.include?('postgres') and not e.include?('postgres-pr') }
+ ::PGconn.connect @config[:host], @config[:port], @config[:options], @config[:tty], @config[:database], @config[:username], @config[:password]
+ elsif $:.any?{ |e| e.include?('postgres-pr')}
::PostgresPR::Connection.new @config[:database], @config[:username], @config[:password], @config[:uri]
- elsif $:.any?{ |e| e.include?('postgres')}
- ::PGconn.connect @config[:host], @config[:port], @config[:options], @config[:tty], @config[:database], @config[:username], @config[:password]
end
end
More information about the ap4r-devel
mailing list