mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
update embed example, shouldnt need require
This commit is contained in:
parent
8a1e33fc1a
commit
550206f68f
1 changed files with 4 additions and 5 deletions
|
@ -36,23 +36,22 @@ workers ENV.fetch("WEB_CONCURRENCY", 2)
|
|||
# This directive tells Puma to first boot the application and load code
|
||||
# before forking the application. This takes advantage of Copy On Write
|
||||
# process behavior so workers use less memory.
|
||||
#
|
||||
require "sidekiq"
|
||||
preload_app!
|
||||
|
||||
# Allow puma to be restarted by `bin/rails restart` command.
|
||||
plugin :tmp_restart
|
||||
|
||||
x = nil
|
||||
on_worker_boot do
|
||||
$sidekiq = Sidekiq.configure_embed do |config|
|
||||
x = Sidekiq.configure_embed do |config|
|
||||
config.queues = %w[critical default low]
|
||||
# don't raise this unless you know your app has available CPU time to burn.
|
||||
# it's easy to overload a Ruby process with too many threads.
|
||||
config.concurrency = 2
|
||||
end
|
||||
$sidekiq&.run
|
||||
x&.run
|
||||
end
|
||||
|
||||
on_worker_shutdown do
|
||||
$sidekiq&.stop
|
||||
x&.stop
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue