diff options
author | Dennis Schubert <mail@dennis-schubert.de> | 2022-09-09 05:33:37 +0300 |
---|---|---|
committer | Dennis Schubert <mail@dennis-schubert.de> | 2022-09-09 05:33:37 +0300 |
commit | 97cfc80a1fe6b712d15c13081cc938d3650fbdb1 (patch) | |
tree | 7a391584558791deb499babe54d9bd5a5e54c756 /app | |
parent | bb80ca33948a7b728cb9083d090c4f8fddbbaec2 (diff) |
Replace Unicorn with Puma
… and drop the single_process_mode. See the included Changelog entry
for full details on what this change means.
Diffstat (limited to 'app')
-rw-r--r-- | app/workers/archive_base.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/workers/archive_base.rb b/app/workers/archive_base.rb index e1b641ae6..6b8b38a82 100644 --- a/app/workers/archive_base.rb +++ b/app/workers/archive_base.rb @@ -27,12 +27,17 @@ module Workers end def currently_running_archive_jobs - return 0 if AppConfig.environment.single_process_mode? - Sidekiq::Workers.new.count do |process_id, thread_id, work| !(Process.pid.to_s == process_id.split(":")[1] && Thread.current.object_id.to_s(36) == thread_id) && ArchiveBase.subclasses.map(&:to_s).include?(work["payload"]["class"]) end + rescue Redis::CannotConnectError + # If code gets to this point and there is no Redis conenction, we're + # running in a Test environment and have not mocked Sidekiq::Workers, so + # we're not testing the concurrency-limiting behavior. + # There is no way a production pod will run into this code, as diaspora* + # refuses to start without redis. + 0 end end end |