| Age | Commit message (Collapse) | Author |
|
Default Memcached configuration allows for a maximum object of 1MB and
will fail to set the key if it is too large. The key will be deleted from
memcached if it fails to be set. This is needed to avoid an issue with
cache_db session backend using the old value stored in memcached, instead
of the newer value stored in the database.
|
|
|
|
|
|
|
|
Refactored cache expiry logic for Locmemcache to make consistent across
all places where accessed, and correctly handle None as expiry time.
|
|
cache.add() incorrectly succeeded when there was an existing key
with an infinite (None) timeout.
|
|
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
|
|
This feature allows the default `TIMEOUT` Cache argument to be set to `None`,
so that cache instances can set a non-expiring key as the default,
instead of using the default value of 5 minutes.
Previously, this was possible only by passing `None` as an argument to
the set() method of objects of type `BaseCache` (and subtypes).
|
|
import_string().
Thanks Aymeric Augustin for the suggestion and review.
|
|
This commit touchs various parts of the code base and test framework. Any
found usage of opening a cursor for the sake of initializing a connection
has been replaced with 'ensure_connection()'.
|
|
|
|
This only affects the new cache api and not the deprecated get_cache.
Refs #21012
|
|
Actually comitted the code now :þ
|
|
|
|
Thanks Curtis Malony and Florian Apolloner.
Squashed commit of the following:
commit 3380495e93f5e81b80a251b03ddb0a80b17685f5
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date: Sat Nov 23 14:18:07 2013 +0100
Looked up the template_fragments cache at runtime.
commit 905a74f52b24a198f802520ff06290a94dedc687
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date: Sat Nov 23 14:19:48 2013 +0100
Removed all uses of create_cache.
Refactored the cache tests significantly.
Made it safe to override the CACHES setting.
commit 35e289fe9285feffed3c60657af9279a6a2cfccc
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date: Sat Nov 23 12:23:57 2013 +0100
Removed create_cache function.
commit 8e274f747a1f1c0c0e6c37873e29067f7fa022e8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date: Sat Nov 23 12:04:52 2013 +0100
Updated docs to describe a simplified cache backend API.
commit ee7eb0f73e6d4699edcf5d357dce715224525cf6
Author: Curtis Maloney <curtis@tinbrain.net>
Date: Sat Oct 19 09:49:24 2013 +1100
Fixed #21012 -- Thread-local caches, like databases.
|
|
|
|
* Safer for use in multiprocess environments
* Better random culling
* Cache files use less disk space
* Safer delete behavior
Also fixed #15806, fixed #15825.
|
|
|
|
|
|
|
|
|
|
|
|
The precision of time.time() is OS specific and it is possible for the
resolution to be low enough to allow reading a cache key previously set
with a timeout of 0.
|
|
DatabaseCache uses raw cursors to bypass the ORM. This prevents it from
being used by database backends that require special handling of datetime
values.
There is no easy way to test this, so no tests added.
|
|
|
|
Thanks joseph at vertstudios.com for the suggestion.
|
|
local variables
|
|
|
|
|
|
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
|
|
This was a shim for pre-Python 2.7 support.
|
|
|
|
|
|
self._lock.reader()/writer() blocks
Additionaly added pickled=None initially and check for none before
returning in get
|
|
Also, streamline the use of 0 and None between cache backends.
|
|
Thanks Anssi for haggling until I implemented this.
This change alleviates the need for atomic_if_autocommit. When
autocommit is disabled for a database, atomic will simply create and
release savepoints, and not commit anything. This honors the contract of
not doing any transaction management.
This change also makes the hack to allow using atomic within the legacy
transaction management redundant.
None of the above will work with SQLite, because of a flaw in the design
of the sqlite3 library. This is a known limitation that cannot be lifted
without unacceptable side effects eg. triggering arbitrary commits.
|
|
The atomic block provides a clean rollback to a savepoint on failed writes.
The ticket reported a race condition which I don't know how to test.
|
|
Since "unless managed" now means "if database-level autocommit",
committing or rolling back doesn't have any effect.
Restored transactional integrity in a few places that relied on
automatically-started transactions with a transitory API.
|
|
Introduced a public function
django.core.cache.utils.make_template_fragment_key
Thanks @chrismedrela for fruitful cooperation.
|
|
|
|
|
|
|
|
Thanks Carl Meyer for the report.
|
|
|
|
This is a provisional change. See #19221 for details.
|
|
Fixed #18582 -- Added a no-op close to BaseCache
|
|
There was a problem caused by Postgres 9.0+ having bytea_output default
value of 'hex' and cache backend inserting the content as 'bytes' into
a column of type TEXT. Fixed by converting the bytes value to a string
before insert.
|
|
|
|
Thanks Michael Manfre for the report and initial patch and
Tobias McNulty for the review.
|
|
real issues, or b) were impossible to hit.
|