Sha256: cdc55c7f4b0a5fed76365b00cb42f820b4296d9e3bd55b11dd6debcb0f08f827

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

module PgBouncerHero
  class Connection

    def initialize(host, port, user, password, dbname)
      @host = host
      @port = port
      @user = user
      @password = password
      @dbname = dbname
    end

    def connection
      begin
        PG.connect(
          host: @host,
          port: @port,
          user: @user,
          password: @password,
          dbname: @dbname,
          connect_timeout: 5
        )
      rescue => e
        Rails.logger.info(e)
        nil
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pgbouncerhero-0.1.0 lib/pgbouncerhero/connection.rb