You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,52 @@ When receiving a `QUIT` signal, if workers still have jobs in-flight, these will
145
145
146
146
If processes have no chance of cleaning up before exiting (e.g. if someone pulls a cable somewhere), in-flight jobs might remain claimed by the processes executing them. Processes send heartbeats, and the supervisor checks and prunes processes with expired heartbeats, which will release any claimed jobs back to their queues. You can configure both the frequency of heartbeats and the threshold to consider a process dead. See the section below for this.
147
147
148
+
149
+
### Dedicated database configuration
150
+
151
+
Solid Queue can be configured to run on a different database than the main application.
152
+
153
+
Configure the `connects_to` option in `config/application.rb` or your environment config like so, where `:solid_queue` is the identifier for your dedicated Solid Queue database.
Add the dedicated database configuration to `config/database.yml`, differentiating between the main `:primary` database and the dedicated `:solid_queue` database. Make sure to include the `migrations_paths` for the solid queue database. This is where migration files for Solid Queue tables will reside.
160
+
161
+
```yml
162
+
default: &default
163
+
adapter: sqlite3
164
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
165
+
timeout: 5000
166
+
167
+
solid_queue: &solid_queue
168
+
<<: *default
169
+
migrations_paths: db/solid_queue_migrate
170
+
171
+
development:
172
+
primary:
173
+
<<: *default
174
+
database: storage/development.sqlite3
175
+
solid_queue:
176
+
<<: *solid_queue
177
+
database: storage/development_solid_queue.sqlite3
178
+
```
179
+
180
+
Install migrations and specify the dedicated database name with the `DATABASE` option. This will create the Solid Queue migration files in a separate directory, matching the value provided in `migrations_paths` in `config/database.yml`.
Note: If you've already run the solid queue install command (`bin/rails generate solid_queue:install`), the migration files will have already been generated under the primary database's `db/migrate/` directory. You can remove these files and keep the ones generated by the database-specific migration installation above.
187
+
188
+
Finally, run the migrations:
189
+
190
+
```bash
191
+
$ bin/rails db:migrate
192
+
```
193
+
148
194
### Other configuration settings
149
195
_Note_: The settings in this section should be set in your `config/application.rb` or your environment config like this: `config.solid_queue.silence_polling = true`
0 commit comments