Skip to content

Commit 5857eab

Browse files
committed
Fix tests with SSL
1 parent b3deb45 commit 5857eab

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

config/initializers/que.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@
1515

1616
def Que.start!
1717
require 'que/locker'
18+
require 'que/db_connection_url'
1819

1920
# Workaround for https://github.com/chanks/que/pull/192
2021
require 'active_record/base'
21-
Que.locker = Que::Locker.new(**Rails.application.config.x.que)
22+
23+
# Build connection URL with SSL parameters from database config
24+
# Workaround for https://github.com/que-rb/que/issues/442
25+
db_config = ActiveRecord::Base.connection_db_config.configuration_hash
26+
connection_url = Que::DBConnectionURL.build_connection_url(db_config)
27+
28+
Que.locker = Que::Locker.new(connection_url: connection_url, **Rails.application.config.x.que)
2229
end
2330

2431
def Que.stop!

0 commit comments

Comments
 (0)