1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/guides
Sam Bostock e79364610c
Fallback to $MEMCACHE_SERVERS if no servers given
By default, Dalli has two fallbacks if no server addresses are given:

- $MEMCACHE_SERVERS
- "127.0.0.1:11211"

However, MemCacheStore does its own check for addresses, and falls back
to "localhost:11211" if none are present.

This can lead to bugs in migrations from the deprecated :dalli_store
(provided by the Dalli) to :mem_cache_store:

```diff
-config.cache_store = :dalli_store     # could be implicitly relying on $MEMCACHE_SERVERS
+config.cache_store = :mem_cache_store # ignores $MEMCACHE_SERVERS
```

By removing our own fallback and simply passing `nil` to Dalli::Client,
we get its fallback logic for free. Tests are added so we can detect if
this ever changes.
2020-10-20 23:50:52 -04:00
..
assets Add gitattributes for vendored and generated files [ci-skip] 2020-10-04 16:44:37 -05:00
bug_report_templates Add Action Mailbox bug report templates 2020-07-15 11:04:12 -04:00
rails_guides Add copy button for copying guide code examples [skip ci] 2020-10-01 16:32:43 +02:00
source Fallback to $MEMCACHE_SERVERS if no servers given 2020-10-20 23:50:52 -04:00
.document
CHANGELOG.md Fallback to $MEMCACHE_SERVERS if no servers given 2020-10-20 23:50:52 -04:00
rails_guides.rb
Rakefile Remove references to WARNINGS environment variable [ci skip] 2020-07-05 16:40:52 +01:00
w3c_validator.rb