tpt-rails 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0120c3d9cc977ba7e0ada28c749fc7a480b3ba24f279cb1577eec6779828878
4
- data.tar.gz: 797a1203b8c808f9577b12d9bfe6a564b9d66d317b16e77069c4b484e3bfa32d
3
+ metadata.gz: 186ac4371bdca9ada2a7d9b56af210cb801eb8be69f7f52ef61f88bc9c3456e2
4
+ data.tar.gz: ce8c4ad020f1fc1fc148f0b94ea1f0267f5578137f56207a863bcc1543bb5b03
5
5
  SHA512:
6
- metadata.gz: f18892967d7df60a7a2c08b43e3f94975bfe1a7504cab6c2e25107df5fa264def7bdaeaca85174311d47ac627ffb8995feeeec8fc52c4e19f0cab78dcc1953aa
7
- data.tar.gz: 819564c6a8682f9f2a432988b3ad4fb62eabde0ea09052ad717d51a512cd251e184e0afd2bd9ac83bf334cc9d116c743939600703ab95c2f5dbd4af5d9a99455
6
+ metadata.gz: 9e038cdd076adedf6e8fa84c18fae51e1640d8be70b00e507e03ce56503138c18c3ebaf583935fd418a23b1ce3c1dcd50d7978a54dd28fff78ba46af26b4d0d3
7
+ data.tar.gz: 17e293fcb6566795d5d220e68dcff771b5b69c4bcc6985514aeb523f3175e195350abb538121589435b50037f749efbe4149e3a95e800a0ec54c6c38d80a97a0
@@ -5,6 +5,6 @@ class Tpt::Rails::ConfigurationGenerator < ::Rails::Generators::Base
5
5
 
6
6
  def configure
7
7
  route "mount Tpt::Rails::Engine => '/'"
8
- template 'config/initializers/tpt_rails.rb'
8
+ directory 'config'
9
9
  end
10
10
  end
@@ -0,0 +1,52 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
+ threads min_threads_count, max_threads_count
10
+
11
+ # Specifies the `worker_timeout` threshold that Puma will use to wait before
12
+ # terminating a worker in development environments.
13
+ #
14
+ worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15
+
16
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
17
+ #
18
+ port ENV.fetch("PORT") { 3000 }
19
+
20
+ # Specifies the `environment` that Puma will run in.
21
+ #
22
+ environment ENV.fetch("RAILS_ENV") { "development" }
23
+
24
+ # Specifies the `pidfile` that Puma will use.
25
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
26
+
27
+ before_fork do
28
+ Tpt::Rails::PumaStatsCollector.run(metrics_client: Tpt::Rails.statsd)
29
+ end
30
+
31
+ # Specifies the number of `workers` to boot in clustered mode.
32
+ # Workers are forked web server processes. If using threads and workers together
33
+ # the concurrency of the application would be max `threads` * `workers`.
34
+ # Workers do not work on JRuby or Windows (both of which do not support
35
+ # processes).
36
+
37
+ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
38
+
39
+ on_worker_boot do
40
+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
41
+ ActiveRecord::Base.establish_connection
42
+ end
43
+
44
+ # Use the `preload_app!` method when specifying a `workers` number.
45
+ # This directive tells Puma to first boot the application and load code
46
+ # before forking the application. This takes advantage of Copy On Write
47
+ # process behavior so workers use less memory.
48
+
49
+ preload_app!
50
+
51
+ # Allow puma to be restarted by `rails restart` command.
52
+ plugin :tmp_restart
@@ -1,6 +1,6 @@
1
1
  module Tpt
2
2
  module Rails
3
3
  # Do not change this manually. Our tooling will do it automatically.
4
- VERSION = '1.5.2'
4
+ VERSION = '1.5.3'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tpt-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - TpT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-19 00:00:00.000000000 Z
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -93,6 +93,7 @@ files:
93
93
  - config/routes.rb
94
94
  - lib/generators/tpt/rails/configuration/configuration_generator.rb
95
95
  - lib/generators/tpt/rails/configuration/templates/config/initializers/tpt_rails.rb
96
+ - lib/generators/tpt/rails/configuration/templates/config/puma.rb
96
97
  - lib/generators/tpt/rails/continuous_integration/continuous_integration_generator.rb
97
98
  - lib/generators/tpt/rails/continuous_integration/templates/ci/Dockerfile.tt
98
99
  - lib/generators/tpt/rails/continuous_integration/templates/ci/docker-compose.yaml.tt