mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #14199 -- Added a missing table creation statement in the db cache backend cull implementation, and added tests for cache culling. Thanks to Tim for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13678 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
1
django/core/cache/backends/db.py
vendored
1
django/core/cache/backends/db.py
vendored
@@ -124,6 +124,7 @@ class CacheClass(BaseCache):
|
||||
if self._cull_frequency == 0:
|
||||
self.clear()
|
||||
else:
|
||||
table = connections[db].ops.quote_name(self._table)
|
||||
cursor.execute("DELETE FROM %s WHERE expires < %%s" % table,
|
||||
[connections[db].ops.value_to_db_datetime(now)])
|
||||
cursor.execute("SELECT COUNT(*) FROM %s" % table)
|
||||
|
||||
Reference in New Issue
Block a user