Skip to content

Commit

Permalink
use workers independent of environment; minor stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Bartels committed Nov 20, 2023
1 parent 6bf4489 commit 7762445
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The core concepts are:
## Images
We provide container images at:

- projectdb: https://hub.docker.com/r/brtz/projectdb.
- projectdb: https://hub.docker.com/r/brtz/projectdb
- projectdbctl: https://hub.docker.com/r/brtz/projectdbctl

Please check the tags. Versioning is not done by doing semver, but in a rolling release style with the tag's datetime.
Expand Down
8 changes: 3 additions & 5 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
threads min_threads_count, max_threads_count

# Specifies that the worker count should equal the number of processors in production.
if ENV["RAILS_ENV"] == "production"
require "concurrent-ruby"
worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count })
workers worker_count if worker_count > 1
end
require "concurrent-ruby"
worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count })
workers worker_count if worker_count > 1

# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
Expand Down
5 changes: 3 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
Secret.create(name: "naughties", content: "Peer, Piep", environment: third_environment)
Secret.create(name: "behaved", content: "Nils", environment: third_environment)

for i in 1..2000 do
puts "at #{i} / 2000" if i % 100 == 0
amount = 1000
for i in 1..amount do
puts "at #{i} / #{amount}" if i % 100 == 0

project = Project.create(name: "Project #{i}", shorthandle: "p#{i}", description: "#{i}", user: santa, custom_id: 1000 + i)
environment = Environment.create(name: "Environment #{i}", shorthandle: "e#{i}", project_id: project.id)
Expand Down

0 comments on commit 7762445

Please sign in to comment.