Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/launcher.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'proxy/log'
require 'proxy/sd_notify'
require 'proxy/settings'
require 'proxy/signal_handler'
require 'proxy/log_buffer/trace_decorator'
require 'sd_notify'

CIPHERS = ['ECDHE-RSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES256-GCM-SHA384',
'AES128-GCM-SHA256', 'AES256-GCM-SHA384', 'AES128-SHA256',
Expand Down Expand Up @@ -212,7 +212,7 @@ def install_webrick_callback!(*apps)

def launched(apps)
logger.info("Smart proxy has launched on #{apps.size} socket(s), waiting for requests")
Proxy::SdNotify.new.tap { |sd| sd.ready if sd.active? }
SdNotify.ready
end
end
end
30 changes: 0 additions & 30 deletions lib/proxy/sd_notify.rb

This file was deleted.

1 change: 1 addition & 0 deletions smart_proxy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Gem::Specification.new do |s|
s.add_dependency 'json'
s.add_dependency 'logging'
s.add_dependency 'rack', '>= 1.3'
s.add_dependency 'sd_notify', '~> 0.1'
s.add_dependency 'sinatra'
s.description = <<~EOF
Foreman Proxy is used via The Foreman Project, it allows Foreman to manage
Expand Down
14 changes: 1 addition & 13 deletions test/launcher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,7 @@ def test_install_webrick_callback

def test_launched_with_sdnotify
@launcher.logger.expects(:info).with(includes('2 socket(s)'))
sd_notify = mock('SdNotify')
sd_notify.expects(:active?).returns(true)
sd_notify.expects(:ready)
Proxy::SdNotify.expects(:new).returns(sd_notify)
@launcher.launched([:app1, :app2])
end

def test_launched_with_sdnotify_inactive
@launcher.logger.expects(:info).with(includes('2 socket(s)'))
sd_notify = mock('SdNotify')
sd_notify.expects(:active?).returns(false)
sd_notify.expects(:ready).never
Proxy::SdNotify.expects(:new).returns(sd_notify)
::SdNotify.expects(:ready)
@launcher.launched([:app1, :app2])
end
end
58 changes: 0 additions & 58 deletions test/sd_notify_test.rb

This file was deleted.