Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove DB_URL constant. Parse URL directly in connection object.

  • Loading branch information...
commit 2629f2a59fce141c333c8561db63d9571b8a9f9d 1 parent 6057420
@glenngillen glenngillen authored
Showing with 5 additions and 6 deletions.
  1. +0 −5 lib/queue_classic.rb
  2. +5 −1 lib/queue_classic/conn.rb
View
5 lib/queue_classic.rb
@@ -18,11 +18,6 @@ module QC
SqlFunctions = File.join(QC::Root, "/sql/ddl.sql")
DropSqlFunctions = File.join(QC::Root, "/sql/drop_ddl.sql")
- DB_URL =
- ENV["QC_DATABASE_URL"] ||
- ENV["DATABASE_URL"] ||
- raise(ArgumentError, "missing QC_DATABASE_URL or DATABASE_URL")
-
# You can use the APP_NAME to query for
# postgres related process information in the
# pg_stat_activity table. Don't set this unless
View
6 lib/queue_classic/conn.rb
@@ -84,7 +84,11 @@ def connect
end
def db_url
- URI.parse(DB_URL)
+ return @db_url if @db_url
+ url = ENV["QC_DATABASE_URL"] ||
+ ENV["DATABASE_URL"] ||
+ raise(ArgumentError, "missing QC_DATABASE_URL or DATABASE_URL")
+ @db_url = URI.parse(url)
end
def log(msg)
Please sign in to comment.
Something went wrong with that request. Please try again.