Work around Rails' shard swapping lock in the Solid Cache config
Because solid cache started using shard swapping when given a `database:` key in https://github.com/rails/solid_cache/pull/219, and Rails doesn't distinguish which database is being swapped and which was locked. Hopefully I can make a change upstream that will enable swap locking only for a specific databases. Until then, let's just use a slightly more verbose configuration to work around it.
This commit is contained in:
+11
-6
@@ -1,17 +1,22 @@
|
||||
default: &default
|
||||
default_options: &default_options
|
||||
store_options:
|
||||
# Cap age of oldest cache entry to fulfill retention policies
|
||||
# max_age: <%= 60.days.to_i %>
|
||||
max_size: <%= 256.megabytes %>
|
||||
namespace: <%= Rails.env %>
|
||||
|
||||
default_connection: &default_connection
|
||||
connects_to:
|
||||
database:
|
||||
writing: :cache
|
||||
|
||||
development:
|
||||
database: cache
|
||||
<<: *default
|
||||
<<: *default_connection
|
||||
<<: *default_options
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
<<: *default_options
|
||||
|
||||
production:
|
||||
database: cache
|
||||
<<: *default
|
||||
<<: *default_connection
|
||||
<<: *default_options
|
||||
|
||||
Reference in New Issue
Block a user