Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
Django-Redis-Cache
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared
Django-Redis-Cache
Commits
9e442c82
Commit
9e442c82
authored
Aug 11, 2015
by
Sean Bleier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #99 from gnulnx/jf/delete_many
Jf/delete many
parents
e8b93309
4787000c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
AUTHORS.rst
AUTHORS.rst
+1
-0
single.py
redis_cache/backends/single.py
+2
-1
base_tests.py
tests/testapp/tests/base_tests.py
+2
-0
No files found.
AUTHORS.rst
View file @
9e442c82
...
@@ -17,4 +17,5 @@ wtracyliu / wtracyliu <https://github.com/wtracyliu>
...
@@ -17,4 +17,5 @@ wtracyliu / wtracyliu <https://github.com/wtracyliu>
Florent Messa / thoas <https://github.com/thoas>
Florent Messa / thoas <https://github.com/thoas>
Markus Kaiserswerth / mkai <https://github.com/mkai>
Markus Kaiserswerth / mkai <https://github.com/mkai>
Michael Lindemuth / mlindemu <https://github.com/mlindemu>
Michael Lindemuth / mlindemu <https://github.com/mlindemu>
John Furr / gnulnx <https://github.com/gnulnx>
Christian Pedersen / chripede <https://github.com/chripede>
Christian Pedersen / chripede <https://github.com/chripede>
redis_cache/backends/single.py
View file @
9e442c82
...
@@ -34,7 +34,8 @@ class RedisCache(BaseRedisCache):
...
@@ -34,7 +34,8 @@ class RedisCache(BaseRedisCache):
def
delete_many
(
self
,
keys
,
version
=
None
):
def
delete_many
(
self
,
keys
,
version
=
None
):
"""Remove multiple keys at once."""
"""Remove multiple keys at once."""
versioned_keys
=
self
.
make_keys
(
keys
,
version
=
version
)
versioned_keys
=
self
.
make_keys
(
keys
,
version
=
version
)
self
.
_delete_many
(
self
.
master_client
,
versioned_keys
)
if
versioned_keys
:
self
.
_delete_many
(
self
.
master_client
,
versioned_keys
)
def
clear
(
self
,
version
=
None
):
def
clear
(
self
,
version
=
None
):
"""Flush cache keys.
"""Flush cache keys.
...
...
tests/testapp/tests/base_tests.py
View file @
9e442c82
...
@@ -358,6 +358,8 @@ class BaseRedisTestCase(SetupMixin):
...
@@ -358,6 +358,8 @@ class BaseRedisTestCase(SetupMixin):
self
.
assertIsNone
(
self
.
cache
.
get
(
"key1"
))
self
.
assertIsNone
(
self
.
cache
.
get
(
"key1"
))
self
.
assertIsNone
(
self
.
cache
.
get
(
"key2"
))
self
.
assertIsNone
(
self
.
cache
.
get
(
"key2"
))
self
.
assertEqual
(
self
.
cache
.
get
(
"key3"
),
"ham"
)
self
.
assertEqual
(
self
.
cache
.
get
(
"key3"
),
"ham"
)
# Test that passing an empty list fails silently
self
.
cache
.
delete_many
([])
def
test_clear
(
self
):
def
test_clear
(
self
):
# The cache can be emptied using clear
# The cache can be emptied using clear
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment