From 396056f6e890cc512807cc1675aef66a0723806e Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Tue, 10 Sep 2024 20:44:05 +0200 Subject: [PATCH] Change default config file from `solid_queue.yml` to just `queue.yml` Following Solid Cache's change in https://github.com/rails/solid_cache/pull/222. As we aren't still in version 1.0, fine to do this as a breaking change for now. --- README.md | 4 ++-- UPGRADING.md | 6 +++--- lib/generators/solid_queue/install/USAGE | 1 + lib/generators/solid_queue/install/install_generator.rb | 2 +- .../install/templates/config/{solid_queue.yml => queue.yml} | 0 lib/solid_queue/configuration.rb | 2 +- test/dummy/config/{solid_queue.yml => queue.yml} | 0 7 files changed, 8 insertions(+), 7 deletions(-) rename lib/generators/solid_queue/install/templates/config/{solid_queue.yml => queue.yml} (100%) rename test/dummy/config/{solid_queue.yml => queue.yml} (100%) diff --git a/README.md b/README.md index 256a7526..de1695b7 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Solid Queue is configured by default in new Rails 8 applications. But if you're 1. `bundle add solid_queue` 2. `bin/rails solid_queue:install` -This will configure Solid Queue as the production Active Job backend, create the configuration files `config/solid_queue.yml` and `config/recurring.yml`, and create the `db/queue_schema.rb`. It'll also create a `bin/jobs` executable wrapper that you can use to start Solid Queue. +This will configure Solid Queue as the production Active Job backend, create the configuration files `config/queue.yml` and `config/recurring.yml`, and create the `db/queue_schema.rb`. It'll also create a `bin/jobs` executable wrapper that you can use to start Solid Queue. Once you've done that, you will then have to add the configuration for the queue database in `config/database.yml`. If you're using sqlite, it'll look like this: @@ -90,7 +90,7 @@ We have several types of actors in Solid Queue: Solid Queue's supervisor will fork a separate process for each supervised worker/dispatcher/scheduler. -By default, Solid Queue will try to find your configuration under `config/solid_queue.yml`, but you can set a different path using the environment variable `SOLID_QUEUE_CONFIG` or by using the `-c/--config_file` option with `bin/jobs`, like this: +By default, Solid Queue will try to find your configuration under `config/queue.yml`, but you can set a different path using the environment variable `SOLID_QUEUE_CONFIG` or by using the `-c/--config_file` option with `bin/jobs`, like this: ``` bin/jobs -c config/calendar.yml diff --git a/UPGRADING.md b/UPGRADING.md index bb3d7f60..3fa46cee 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,7 +1,7 @@ # Upgrading to version 0.9.x -This version changes how recurring tasks are configured. Before, they would be defined as part of the _dispatcher_ configuration. Now they've been upgraded to their own configuration file, and a dedicated process (the _scheduler_) to manage them. Check the _Recurring tasks_ section in the `README` to learn how to configure them in detail. - -In short, they live now in `config/recurring.yml` (by default) and follow the same format as before when they lived under `dispatchers > recurring_tasks`. +This version has two breaking changes regarding configuration: +- The default configuration file has changed from `config/solid_queue.yml` to `config/queue.yml`. +- Recurring tasks are now defined in `config/recurring.yml` (by default). Before, they would be defined as part of the _dispatcher_ configuration. Now they've been upgraded to their own configuration file, and a dedicated process (the _scheduler_) to manage them. Check the _Recurring tasks_ section in the `README` to learn how to configure them in detail. They still follow the same format as before when they lived under `dispatchers > recurring_tasks`. # Upgrading to version 0.8.x *IMPORTANT*: This version collapsed all migrations into a single `db/queue_schema.rb`, that will use a separate `queue` database. If you're upgrading from a version < 0.6.0, you need to upgrade to 0.6.0 first, ensure all migrations are up-to-date, and then upgrade further. diff --git a/lib/generators/solid_queue/install/USAGE b/lib/generators/solid_queue/install/USAGE index 2450ad83..797bf1ee 100644 --- a/lib/generators/solid_queue/install/USAGE +++ b/lib/generators/solid_queue/install/USAGE @@ -6,5 +6,6 @@ Example: This will perform the following: Adds solid_queue db schema + Adds default configurations Replaces Active Job's adapter in environment configuration Installs bin/jobs binstub to start the supervisor diff --git a/lib/generators/solid_queue/install/install_generator.rb b/lib/generators/solid_queue/install/install_generator.rb index c7e8330d..85a76d1b 100644 --- a/lib/generators/solid_queue/install/install_generator.rb +++ b/lib/generators/solid_queue/install/install_generator.rb @@ -4,7 +4,7 @@ class SolidQueue::InstallGenerator < Rails::Generators::Base source_root File.expand_path("templates", __dir__) def copy_files - template "config/solid_queue.yml" + template "config/queue.yml" template "db/queue_schema.rb" template "bin/jobs" chmod "bin/jobs", 0755 & ~File.umask, verbose: false diff --git a/lib/generators/solid_queue/install/templates/config/solid_queue.yml b/lib/generators/solid_queue/install/templates/config/queue.yml similarity index 100% rename from lib/generators/solid_queue/install/templates/config/solid_queue.yml rename to lib/generators/solid_queue/install/templates/config/queue.yml diff --git a/lib/solid_queue/configuration.rb b/lib/solid_queue/configuration.rb index 6f999cbc..4e4c928c 100644 --- a/lib/solid_queue/configuration.rb +++ b/lib/solid_queue/configuration.rb @@ -22,7 +22,7 @@ def instantiate concurrency_maintenance_interval: 600 } - DEFAULT_CONFIG_FILE_PATH = "config/solid_queue.yml" + DEFAULT_CONFIG_FILE_PATH = "config/queue.yml" DEFAULT_RECURRING_SCHEDULE_FILE_PATH = "config/recurring.yml" def initialize(**options) diff --git a/test/dummy/config/solid_queue.yml b/test/dummy/config/queue.yml similarity index 100% rename from test/dummy/config/solid_queue.yml rename to test/dummy/config/queue.yml