1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
mperham--sidekiq/bin/sidekiq
Mike Perham 29dca70e24
Introduce Sidekiq::Capsule (#5487)
* Initial work on Sidekiq::Config

* Initial work on Sidekiq::Config

* reduce dependencies in deploy marks

* bare sidekiq and webapp

* Modify runtime to work with Capsules

* Cleanup

* Rename test files to remove test_ prefix

* Update test suite and standard rules to be more compliant

* Move constant definition outside code, per standard formatting

* Loads of changes for introduction of Capsules

* Remove Redis adapter abstraction

* update capsule overview

* Ensure Sidekiq.redis uses the correct pool for jobs running within a Capsule

* Use default_capsule for safety

* Slow down the beat to halve its Redis overhead

* move config fixtures into cfg/

* Add capsule middleware test

* use accessor
2022-08-25 10:15:11 -07:00

37 lines
753 B
Ruby
Executable file

#!/usr/bin/env ruby
# Quiet some warnings we see when running in warning mode:
# RUBYOPT=-w bundle exec sidekiq
$TESTING = false
require_relative "../lib/sidekiq/cli"
def integrate_with_systemd
return unless ENV["NOTIFY_SOCKET"]
Sidekiq.configure_server do |config|
config.logger.info "Enabling systemd notification integration"
require "sidekiq/sd_notify"
config.on(:startup) do
Sidekiq::SdNotify.ready
end
config.on(:shutdown) do
Sidekiq::SdNotify.stopping
end
Sidekiq.start_watchdog if Sidekiq::SdNotify.watchdog?
end
end
begin
cli = Sidekiq::CLI.instance
cli.parse
integrate_with_systemd
cli.run
rescue => e
raise e if $DEBUG
warn e.message
warn e.backtrace.join("\n")
exit 1
end