| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Currently `Rails.cache.clear` raises Errno::ENOENT if it's run just
after cloning a new Rails project. It should succeed without removing
files or directories.
|
|
|
|
| |
an issue with the redis cache, where this code will sometimes throw an error out of SETEX when passing 0 as the `expires_at`.
|
| |
|
|
|
|
| |
[Robin Dupret + Rafael Mendonça França]
|
|
|
|
|
|
|
|
|
|
| |
Adds `read_multi` instrumentation formatted as:
Caches multi read:
- views/david/2/4184ab71db6849621a4d8820fcd2c0ad
- views/david/2/4184ab71db6849621a4d8820fcd2c0ad
- views/david/3/4184ab71db6849621a4d8820fcd2c0ad
- views/david/3/4184ab71db6849621a4d8820fcd2c0ad
|
|
|
|
|
|
|
|
|
| |
This code was there just to convert entries generated in Rails
4.0.0.beta1 applications to a supported format.
It is almost unlikely that any existent application have this cache
entry format in their caches at the point that Rails 5 will be released
so we don't need this code anymore.
|
|
|
|
|
|
|
| |
We should convert when @v is defined not @value.
The test was calling value first that already converts the entry so we
are not catching this bug.
|
|
|
|
| |
Otherwise, it's possible for GC to run in between, and fail the test.
|
| |
|
| |
|
|
|
|
|
|
|
| |
The current implementation of `fetch_multi` returns an array and has no
means to easily backtrack which names yielded which results. By changing
the return value to a Hash we retain the name information. Hash#values
can be used on the response if only the values are needed.
|
|
|
|
|
|
|
|
| |
fixes #13547
The body may use the local cache during rendering. `call`ing the app
doesn't mean that rendering is finished, so we need to wait until
`close` is called on the body.
|
|
|
|
|
|
| |
:mem_cache_store should receive a list of hosts or a dalli client,
otherwise raise it.
Also adding a changelog.
|
|
|
|
|
|
|
| |
:mem_cache_store require dalli, rescue Dalli exceptions, and follow Dalli API.
Memcached gem, for instance, doesnt work anymore, as the API are different.
As we already require one client, we should make sure that client works, and not accept others, and if someone wants to use another memcache client they can write their own store adapter.
|
|\
| |
| |
| |
| |
| |
| |
| | |
support :unless_exist for FileCache
Conflicts:
activesupport/CHANGELOG.md
activesupport/test/caching_test.rb
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ActiveSupport::Cache::MemoryStore
Previously, the cache size of `ActiveSupport::Cache::MemoryStore` was calculated
as the sum of the size of its entries, ignoring the size of keys and any data
structure overhead. This could lead to the calculated cache size sometimes being
10-100x smaller than the memory used, e.g., in the case of small values.
The size of a key/entry pair is now calculated via `#cached_size`:
def cached_size(key, entry)
key.to_s.bytesize + entry.size + PER_ENTRY_OVERHEAD
end
The value of `PER_ENTRY_OVERHEAD` is 240 bytes based on an [empirical
estimation](https://gist.github.com/ssimeonov/6047200) for 64-bit MRI on
1.9.3 and 2.0.
Fixes GH#11512 https://github.com/rails/rails/issues/11512
|
| |
|
|
|
|
|
| |
Add a simple API for fetching a list of entries from the cache, where
any missing entries are computed by a supplied block.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. When comparing the directory to delete against the top level
cache_path, use File.realpath to make sure we aren't comparing two
unequal strings that point to the same path. This occurs, for
example, when cache_path has a trailing slash, which it does in the
default Rails configuration. Since the input to
delete_empty_directories never has a trailing slash, the comparison
will never be true and the top level cache directory (and above) may
be deleted. However…
2. File.delete raises EPERM when trying to delete a directory, so no
directories have ever been deleted. Changing the code to Dir.delete
fixes that.
|
|
|
|
|
| |
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
|
|
|
|
| |
(active_support/dependecies.rb) (issue #8167)
|
|
|
|
| |
implentation
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This time I used ack.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
ActiveSupport::Cache::MemCacheStore
memcache-client was deprecated in favour of dalli in 2010.
|
|\
| |
| | |
#read_entry in ActiveSupport::Cache::FileStore should log details of the exception when an exception is thrown
|
| |
| |
| |
| | |
exception when an exception is thrown.
|
| | |
|
|\ \
| | |
| | | |
Fix cache (FileStore) clear to keep .gitkeep.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Reduce FILENAME_MAX_SIZE in ActiveSupport::Cache::FileStore
|
| | |/
| |/|
| | |
| | | |
In order that temp filenames generated from it will fit in 255 chars. See https://github.com/rails/rails/issues/4907
|
|/ / |
|
|/
|
|
|
|
| |
This reverts commit abe915f23777efe10f17d611bf5718ca855a0704.
This broke all existing keys and it's wrong anyway. The array is just there as a convenience option for building the string. It's intentional that [ "stuff"] and "stuff" generates the same key.
|
|
|
|
| |
minor
|
| |
|
|\
| |
| | |
Fix expanding cache key for single element arrays
|