File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
app/models/jobs/solid_cable Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,14 @@ Update `config/cable.yml` to use the new adapter. connects_to is can be omitted
35
35
if you want to use the primary database.
36
36
37
37
``` yaml
38
- development :
38
+ default : &default
39
39
adapter : solid_cable
40
- silence_polling : true
41
40
polling_interval : 1.second
42
- keep_messages_around_for : 30.minutes
41
+ keep_messages_around_for : 1.day
42
+
43
+ development :
44
+ << : *default
45
+ silence_polling : true
43
46
connects_to :
44
47
database :
45
48
writing : solid_cable_primary
49
52
adapter : test
50
53
51
54
production :
52
- adapter : solid_cable
55
+ << : *default
53
56
polling_interval : 0.1.seconds
54
- keep_messages_around_for : 10.minutes
55
57
` ` `
56
58
57
59
Finally, you need to run the migrations:
@@ -60,5 +62,10 @@ Finally, you need to run the migrations:
60
62
$ bin/rails db:migrate
61
63
```
62
64
65
+ By default messages are kept around forever. SolidCable ships with a job to
66
+ prune messages. You can run ` SolidCable::PruneJob.perform_later ` which removes
67
+ Messages that are older than what is specified in ` keep_messages_around_for `
68
+ setting.
69
+
63
70
## License
64
71
The gem is available as open source under the terms of the [ MIT License] ( https://opensource.org/licenses/MIT ) .
Original file line number Diff line number Diff line change 3
3
module SolidCable
4
4
class PruneJob < ActiveJob ::Base
5
5
def perform
6
- Message . prunable . delete_all
6
+ :: SolidCable :: Message . prunable . delete_all
7
7
end
8
8
end
9
9
end
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
module SolidCable
4
- VERSION = "0.4 .0"
4
+ VERSION = "1.0 .0"
5
5
end
You can’t perform that action at this time.
0 commit comments