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
+35-7Lines changed: 35 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,17 +80,17 @@ For small projects, you can run Solid Queue on the same machine as your webserve
80
80
81
81
Calling `bin/rails solid_queue:install` will automatically add `config.solid_queue.connects_to = { database: { writing: :queue } }` to `config/environments/production.rb`. In order to use Solid Queue in other environments (such as development or staging), you'll need to add a similar configuration(s).
82
82
83
-
For example, if you're using Sqlite in development, update `database.yml` as follows:
83
+
For example, if you're using SQLite in development, update `database.yml` as follows:
84
84
85
-
```yaml
85
+
```diff
86
86
development:
87
87
primary:
88
88
<<: *default
89
89
database: storage/development.sqlite3
90
-
queue:
91
-
<<: *default
92
-
database: storage/development_queue.sqlite3
93
-
migrations_paths: db/queue_migrate
90
+
+ queue:
91
+
+ <<: *default
92
+
+ database: storage/development_queue.sqlite3
93
+
+ migrations_paths: db/queue_migrate
94
94
```
95
95
96
96
Next, add the following to `development.rb`
@@ -101,7 +101,7 @@ Next, add the following to `development.rb`
Once you've added this, again run `db:prepare` to create the Solid Queue database and load the schema.
104
+
Once you've added this, run `db:prepare` to create the Solid Queue database and load the schema.
105
105
106
106
Finally, in order for jobs to be processed, you'll need to have Solid Queue running. In Development, this can be done via the Puma plugin. In `puma.rb` update the following line:
107
107
@@ -110,6 +110,34 @@ Finally, in order for jobs to be processed, you'll need to have Solid Queue runn
110
110
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] || Rails.env.development?
111
111
```
112
112
113
+
**Import Note about Action Cable**: If you use Action Cable (or anything dependent on Action Cable, such as Turbo Streams), you will need to also need to update it to use a database.
114
+
115
+
In `config/cable.yml`
116
+
117
+
```diff
118
+
development:
119
+
- adapter: async
120
+
+ adapter: solid_cable
121
+
+ connects_to:
122
+
+ database:
123
+
+ writing: cable
124
+
+ polling_interval: 0.1.seconds
125
+
+ message_retention: 1.day
126
+
```
127
+
128
+
In `config/database.yml`
129
+
130
+
```diff
131
+
development:
132
+
primary:
133
+
<<: *default
134
+
database: storage/development.sqlite3
135
+
+ cable:
136
+
+ <<: *default
137
+
+ database: storage/development_cable.sqlite3
138
+
+ migrations_paths: db/cable_migrate
139
+
```
140
+
113
141
### Single database configuration
114
142
115
143
Running Solid Queue in a separate database is recommended, but it's also possible to use one single database for both the app and the queue. Just follow these steps:
0 commit comments