mirror of
https://iceshrimp.dev/blueb/Chuckya-fe-standalone.git
synced 2026-01-11 13:33:21 -08:00
Merge commit '2ea9336b68' into glitch-soc/merge-upstream
This commit is contained in:
commit
52fb4f16ef
13 changed files with 134 additions and 31 deletions
|
|
@ -2,19 +2,24 @@
|
|||
|
||||
require_relative '../../lib/mastodon/sidekiq_middleware'
|
||||
|
||||
SIDEKIQ_WILL_PROCESSES_JOBS_FILE = Rails.root.join('tmp', 'sidekiq_process_has_started_and_will_begin_processing_jobs').freeze
|
||||
|
||||
Sidekiq.configure_server do |config|
|
||||
config.redis = REDIS_SIDEKIQ_PARAMS
|
||||
|
||||
# This is used in Kubernetes setups, to signal that the Sidekiq process has started and will begin processing jobs
|
||||
# This comes from https://github.com/sidekiq/sidekiq/wiki/Kubernetes#sidekiq
|
||||
config.on(:startup) do
|
||||
FileUtils.touch(SIDEKIQ_WILL_PROCESSES_JOBS_FILE)
|
||||
end
|
||||
ready_filename = ENV.fetch('MASTODON_SIDEKIQ_READY_FILENAME', nil)
|
||||
if ready_filename
|
||||
raise 'MASTODON_SIDEKIQ_READY_FILENAME is not a valid filename' if File.basename(ready_filename) != ready_filename
|
||||
|
||||
config.on(:shutdown) do
|
||||
FileUtils.rm_f(SIDEKIQ_WILL_PROCESSES_JOBS_FILE)
|
||||
ready_path = Rails.root.join('tmp', ready_filename)
|
||||
|
||||
config.on(:startup) do
|
||||
FileUtils.touch(ready_path)
|
||||
end
|
||||
|
||||
config.on(:shutdown) do
|
||||
FileUtils.rm_f(ready_path)
|
||||
end
|
||||
end
|
||||
|
||||
config.server_middleware do |chain|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue