summaryrefslogtreecommitdiff
path: root/django/core/cache
AgeCommit message (Collapse)Author
2015-02-20[1.8.x] Fixed #24351, #24346 -- Changed the signature of allow_migrate().Loic Bistuer
The new signature enables better support for routing RunPython and RunSQL operations, especially w.r.t. reusable and third-party apps. This commit also takes advantage of the deprecation cycle for the old signature to remove the backward incompatibility introduced in #22583; RunPython and RunSQL won't call allow_migrate() when when the router has the old signature. Thanks Aymeric Augustin and Tim Graham for helping shape up the patch. Refs 22583. Conflicts: django/db/utils.py Backport of bed504d70bede3431a213203c13a33905d6dbf77 from master
2015-02-09[1.8.x] Sorted imports with isort; refs #23860.Tim Graham
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
2014-11-13Fixed #16358 - Made memcache backend delete old value on a failure to set.Michael Manfre
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.
2014-10-12Fixed #23642 -- Made LocMemCache.incr() thread-safe as documentedThomas Chaumeny
2014-10-10Fixed #23625 -- Removed CacheClass shimJaap Roes
2014-06-16Fixed #22845 -- Correctly handled memcached default timeout value.Vincent-Vega
2014-05-09Fixed #22606 -- Locmemcache has_key() failed for infinite cache expiryMalcolm Box
Refactored cache expiry logic for Locmemcache to make consistent across all places where accessed, and correctly handle None as expiry time.
2014-04-23Fixed #22495 -- Locmem cache.add() failed with infinite timeoutsMalcolm Box
cache.add() incorrectly succeeded when there was an existing key with an infinite (None) timeout.
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2014-03-04Fixed #22085 -- Added a feature for setting non-expiring keys as the default.zedr
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).
2014-02-08Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag
import_string(). Thanks Aymeric Augustin for the suggestion and review.
2014-02-02Ensure cursors are closed when no longer needed.Michael Manfre
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()'.
2013-11-24flake8 fixesAlex Gaynor
2013-11-24Properly closed cache connections at the end of the request.Florian Apolloner
This only affects the new cache api and not the deprecated get_cache. Refs #21012
2013-11-23Follow up to e112654fc81ddb3fbffbb8382b004d69367a85feFlorian Apolloner
Actually comitted the code now :þ
2013-11-23A handful of flake8 fixesAlex Gaynor
2013-11-23Fixed #21012 -- New API to access cache backends.Curtis Maloney
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.
2013-11-07Fixed a couple flake8 warnings.Tim Graham
2013-11-07Fixed #20536 -- rewrite of the file based cache backendJaap Roes
* Safer for use in multiprocess environments * Better random culling * Cache files use less disk space * Safer delete behavior Also fixed #15806, fixed #15825.
2013-11-03Fixed all E226 violationsAlex Gaynor
2013-11-02Fixed all E261 warningscoagulant
2013-11-02More attacking E302 violatorsAlex Gaynor
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-10-24Start attacking E231 violationsAlex Gaynor
2013-10-01Fixed #21147 -- Avoided time.time precision issue with cache backends.Michael Manfre
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.
2013-09-26Fixed #21146 - DatabaseCache converts expires to python valueMichael Manfre
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.
2013-09-19Fixed #21125 -- Removed support for cache URI syntaxCurtis Maloney
2013-09-10Fixed #20841 -- Added messages to NotImplementedErrorsGregor MacGregor
Thanks joseph at vertstudios.com for the suggestion.
2013-09-06Fixed a number of flake8 errors -- particularly around unused imports and ↵Alex Gaynor
local variables
2013-09-05Took advantage of django.utils.six.moves.urllib.*.Aymeric Augustin
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-07-29Deprecated django.utils.importlibClaude Paroz
This was a shim for pre-Python 2.7 support.
2013-07-09Fixed #20722 -- Fixed MemcachedCache backend get_many on Python 3.Tim Graham
2013-07-08A few cleanups to capture the minimum amount of code in try/except blocks.Alex Gaynor
2013-07-06Fixed 20613 - moved pickle loads/dumps outside with ↵ersran9
self._lock.reader()/writer() blocks Additionaly added pickled=None initially and check for none before returning in get
2013-05-18Fixed #9595 -- Allow non-expiring cache timeouts.Jacob Burch
Also, streamline the use of 0 and None between cache backends.
2013-03-13Made atomic usable when autocommit is off.Aymeric Augustin
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.
2013-03-11Fixed #11569 -- Wrapped DatabaseCache._base_set in an atomic block.Aymeric Augustin
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.
2013-03-11Deprecated transaction.commit/rollback_unless_managed.Aymeric Augustin
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.
2013-02-24Fixed #19253 -- Extracted template cache key building logicTomek Paczkowski
Introduced a public function django.core.cache.utils.make_template_fragment_key Thanks @chrismedrela for fruitful cooperation.
2013-02-24Fixed #19810 -- MemcachedCache now uses pickle.HIGHEST_PROTOCOLBas Peschier
2013-02-24Fixed #19896 -- Committed after clearing cache in the database.George Song
2013-02-05Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`.Simon Charette
2013-02-04Fixed #17061 -- Factored out importing object from a dotted pathClaude Paroz
Thanks Carl Meyer for the report.
2012-12-29Removed django.core.cache.backends.memcached.CacheClass.Aymeric Augustin
2012-11-11Tweaked cache key creation to avoid strict typing.Aymeric Augustin
This is a provisional change. See #19221 for details.
2012-11-11Merge pull request #218 from mgrouchy/ticket_18582Aymeric Augustin
Fixed #18582 -- Added a no-op close to BaseCache
2012-11-10Fixed #19273 -- Fixed DB cache backend on pg 9.0+ and py3Anssi Kääriäinen
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.
2012-11-10Removed an impossible code path in cache functionClaude Paroz