Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDennis Schubert <mail@dennis-schubert.de>2022-09-09 05:33:37 +0300
committerDennis Schubert <mail@dennis-schubert.de>2022-09-09 05:33:37 +0300
commit97cfc80a1fe6b712d15c13081cc938d3650fbdb1 (patch)
tree7a391584558791deb499babe54d9bd5a5e54c756 /app
parentbb80ca33948a7b728cb9083d090c4f8fddbbaec2 (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.rb9
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