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
86f41d73
Commit
86f41d73
authored
Oct 02, 2015
by
Sean Bleier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #102 from paksu/fix_set_many_versioning
Bugfix: set_many does not set key version
parents
2208beac
37c8ec5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
single.py
redis_cache/backends/single.py
+1
-1
base_tests.py
tests/testapp/tests/base_tests.py
+5
-0
No files found.
redis_cache/backends/single.py
View file @
86f41d73
...
...
@@ -60,7 +60,7 @@ class RedisCache(BaseRedisCache):
If timeout is given, that timeout will be used for the key; otherwise
the default cache timeout will be used.
"""
versioned_keys
=
self
.
make_keys
(
data
.
keys
())
versioned_keys
=
self
.
make_keys
(
data
.
keys
()
,
version
=
version
)
if
timeout
is
None
:
new_data
=
{}
for
key
in
versioned_keys
:
...
...
tests/testapp/tests/base_tests.py
View file @
86f41d73
...
...
@@ -349,6 +349,11 @@ class BaseRedisTestCase(SetupMixin):
self
.
assertIsNone
(
self
.
cache
.
get
(
"key1"
))
self
.
assertIsNone
(
self
.
cache
.
get
(
"key2"
))
def
test_set_many_version
(
self
):
self
.
cache
.
set_many
({
"key1"
:
"spam"
,
"key2"
:
"eggs"
},
version
=
2
)
self
.
assertEqual
(
self
.
cache
.
get
(
"key1"
,
version
=
2
),
"spam"
)
self
.
assertEqual
(
self
.
cache
.
get
(
"key2"
,
version
=
2
),
"eggs"
)
def
test_delete_many
(
self
):
# Multiple keys can be deleted using delete_many
self
.
cache
.
set
(
"key1"
,
"spam"
)
...
...
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