| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Some cache backends support the `unless_exist` option, which tells them
not to overwrite an existing entry. The local cache currently always
stores the new value, even though the backend may have rejected it.
Since we can't tell which value will end up in the backend cache, we
should delete the key from the local cache, so that the next read for
that key will go to the backend and pick up the correct value.
|
| |
|
| |
|
|\
| |
| | |
Add missing documentation for MemoryStore#clear [ci skip]
|
| |
| |
| |
| |
| | |
We were missing some form of documentation for this method, so I've gone ahead
and added some!
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We (GitLab) hit into an issue that somewhere in the middleware
chain was throwing `:warden`, which was caught in the wrapping
middleware, but `LocalCache::Middleware` was not aware of it.
It should look like:
``` ruby
result = catch(:warden) do
@app.call(env)
end
```
Source: https://github.com/hassox/warden/blob/090ed153dbd2f5bf4a1ca672b3018877e21223a4/lib/warden/manager.rb#L35-L37
Using `ensure` could make sure that we would always do the cleanup,
and better yet, avoid `rescue Exception` which we all should know
that could cause some issues which could be very hard to debug.
Please check the discussion thread for more context:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1402#note_25128108
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently `ActiveSupport::Duration` implicitly converts to a seconds
value when used in a calculation except for the explicit examples of
addition and subtraction where the duration is the receiver, e.g:
>> 2 * 1.day
=> 172800
This results in lots of confusion especially when using durations
with dates because adding/subtracting a value from a date treats
integers as a day and not a second, e.g:
>> Date.today
=> Wed, 01 Mar 2017
>> Date.today + 2 * 1.day
=> Mon, 10 Apr 2490
To fix this we're implementing `coerce` so that we can provide a
deprecation warning with the intent of removing the implicit coercion
in Rails 5.2, e.g:
>> 2 * 1.day
DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration
to a Numeric is deprecated and will raise a TypeError in Rails 5.2.
=> 172800
In Rails 5.2 it will raise `TypeError`, e.g:
>> 2 * 1.day
TypeError: ActiveSupport::Duration can't be coerced into Integer
This is the same behavior as with other types in Ruby, e.g:
>> 2 * "foo"
TypeError: String can't be coerced into Integer
>> "foo" * 2
=> "foofoo"
As part of this deprecation add `*` and `/` methods to `AS::Duration`
so that calculations that keep the duration as the receiver work
correctly whether the final receiver is a `Date` or `Time`, e.g:
>> Date.today
=> Wed, 01 Mar 2017
>> Date.today + 1.day * 2
=> Fri, 03 Mar 2017
Fixes #27457.
|
| | |
|
| | |
|
|/
|
|
| |
https://github.com/rails/rails/issues/27066.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
y-yagi/change_increment_and_decrement_to_public_api
change `MemCacheStore#increment` and `MemCacheStore#decrement` to public API [ci skip]
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[ci skip]
I'm not sure why these methods not public. But these methods are public in
other cache stores, I think that may be in public.
Ref:
http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/Store.html#method-i-increment
http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/FileStore.html#method-i-increment
http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/MemoryStore.html#method-i-increment
http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/NullStore.html#method-i-increment
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
| |
Currently mongrel is not maintained.
And it couldn't be built with any Ruby versions that
supported by Rails.
It is reasonable to remove the word "mongrel" in order to avoid
confusion from newcomer.
|
|\
| |
| |
| | |
Remove parameter "options = nil" for #clear
|
| |
| |
| |
| |
| |
| | |
Move new CHANGELOG entry top [ci skip]
Remove parameter "options = nil" for #clear
|
| |
| |
| |
| |
| |
| |
| |
| | |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
|
|
| |
- we are ending sentences properly
- fixing of space issues
- fixed continuity issues in some sentences.
Reverts https://github.com/rails/rails/commit/8fc97d198ef31c1d7a4b9b849b96fc08a667fb02 .
This change reverts making sure we add '.' at end of deprecation sentences.
This is to keep sentences within Rails itself consistent and with a '.' at the end.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reevaluating the log output generated from this instrumentation,
we've found that it wasn't all that useful in practice.
```
Caches multi read:
- views/david/2/4184ab71db6849621a4d8820fcd2c0ad
- views/david/2/4184ab71db6849621a4d8820fcd2c0ad
- views/david/3/4184ab71db6849621a4d8820fcd2c0ad
- views/david/3/4184ab71db6849621a4d8820fcd2c0ad
```
If rendering many templates the output is inscrutable, and it's impossible
to see how many cache misses there were.
Revert ca6aba7f30 and implement a better way later.
|
|\
| |
| | |
Allow to store .keep file in cache directory
|
| | |
|
|\ \
| | |
| | | |
even if a write fails, store the raw value
|
| | | |
|
|\ \ \
| |/ /
|/| | |
rescue memcached errors in a consistent way
|
| | | |
|
|/ / |
|
| | |
|
|/
|
|
| |
this themselves
|
|\
| |
| | |
fast and consistent return when local_cache does not exist
|
| | |
|
|\ \
| |/
|/| |
dry up increment/decrement
|
| | |
|
|/
|
|
|
|
| |
fetch is supposed to behave differently, this was a mistake merged in
https://github.com/rails/rails/pull/22194
|
|\
| |
| | |
call local_cache 1 time instead of 3 times
|
| |
| |
| |
| |
| | |
LocalCache read_entry previously called the local_cache method 3 times,
now it only calls it once and keeps the result in a local variable.
|
|/
|
|
|
| |
extending an instance with a module puts the methods on top of it,
prepend does the same but on the class level, so less work for us and more standard way of doing things
|
|\
| |
| | |
cache nil replies from backend cache so misses are fast too
|
| | |
|
|\ \
| |/
|/| |
FileStore: Long cache keys may result in too long paths due to encoding
|
| | |
|
|\ \
| | |
| | | |
Add nodoc label for protected Cache methods
|