5 Commits

Author SHA1 Message Date
Jani Monoses
17e000aaf9 Remove legacy code from Puma config. 2024-04-05 23:29:07 +03:00
Javi Martín
d8d4c1e9a4 Use systemd to start and monitor puma
Puma 4 is no longer maintained, and Puma 5 removed the option to run
Puma as as daemon. That means that, in order to upgrade, we need to rely
in a process monitoring tool. We're using systemd because it's installed
by default in most (all?) operating systems running Consul Democracy on
production and it's supported by both Puma and the capistrano3-puma gem.

Using systemd means Puma will be automatically started whenever it
crashes, so we no longer need the changes done in commit 40b3c9f2c and
we can now use the default tasks configuration in capistrano3-puma and
capistrano3-delayed-job.

Since Puma is also started automatically when booting the system, we
don't need a cron job to do so anymore and can remove it from the
`schedule.rb` file.
2023-10-24 23:00:12 +02:00
Javi Martín
dcb6450b23 Remove no longer needed --keep-file-descriptors option
We added this option in commit d17b2523c, but Bundler now keeps
descriptors by default. While this behavior was backported to Ruby
3.0.x, we're changing it now because, we've only noticed it now that
we're upgrading to Ruby 3.1.x, since it was first developed for that
version [1].

[1] https://github.com/rubygems/rubygems/pull/4812/commits/88b7a3e7e2
2023-09-12 15:21:47 +02:00
Javi Martín
69be13f7a7 Keep default puma settings in the test environment
The test environment was using the file in `config/puma.rb`, meaning it
wouldn't work with Rails 5.1, which uses a different setup for Puma.

I've decided to create a new file called `defaults.rb`, which will be
used in every environment but development and test. We could also add an
empty file in `config/puma/test.rb`; I think that's less intuitive, but
it's a subjective opinion.
2019-11-19 21:33:22 +01:00
Javi Martín
1e32455cd9 Add puma configuration to version control
We were using Capistrano's shared folder because it was the default
folder used by the capistrano-puma gem. However, it's easier to manage
it if it's under version control.

So we're moving the old `puma.rb` to `puma/development.rb`, and we use
the new `puma.rb` file for all environments except development. Anyone
installing CONSUL can change these files at will or change the specific
files for preproduction, production and staging environments.
2019-11-13 13:28:27 +01:00