Skip to content

Commit 320dfc8

Browse files
authored
refactor: cleanup puma config (#617)
Currently we've got two slightly different implementations of the same check/logic, which is silly 😅
1 parent 2e975ce commit 320dfc8

File tree

1 file changed

+3
-9
lines changed
  • variants/backend-base/config

1 file changed

+3
-9
lines changed

variants/backend-base/config/puma.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,17 @@
88
min_threads_count = ENV.fetch("RAILS_MIN_THREADS", max_threads_count)
99
threads min_threads_count, max_threads_count
1010

11+
rails_env = ENV.fetch("RAILS_ENV", "development")
12+
1113
# Specifies the `worker_timeout` threshold that Puma will use to wait before
1214
# terminating a worker in development environments.
1315
#
14-
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
16+
worker_timeout 3600 if rails_env == "development"
1517

1618
port ENV.fetch("PORT", 3000)
1719

18-
rails_env = ENV.fetch("RAILS_ENV", "development")
19-
2020
environment rails_env
2121

22-
if rails_env == "development"
23-
# set a generous worker timeout so that the worker isn't killed by puma when
24-
# suspended by a debugger
25-
worker_timeout(3600)
26-
end
27-
2822
# Specifies the `pidfile` that Puma will use.
2923
pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid")
3024

0 commit comments

Comments
 (0)