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
6ec2fd72
Commit
6ec2fd72
authored
Jul 20, 2015
by
Sean Bleier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #89 from sebleier/unstable
Unstable
parents
cc82dcf2
6e4be2c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
base.py
redis_cache/backends/base.py
+12
-2
connection.py
redis_cache/connection.py
+5
-0
setup.py
setup.py
+1
-1
No files found.
redis_cache/backends/base.py
View file @
6ec2fd72
...
...
@@ -57,6 +57,7 @@ class BaseRedisCache(BaseCache):
self
.
parser_class
=
self
.
get_parser_class
()
self
.
pickle_version
=
self
.
get_pickle_version
()
self
.
socket_timeout
=
self
.
get_socket_timeout
()
self
.
socket_connect_timeout
=
self
.
get_socket_connect_timeout
()
self
.
connection_pool_class
=
self
.
get_connection_pool_class
()
self
.
connection_pool_class_kwargs
=
(
self
.
get_connection_pool_class_kwargs
()
...
...
@@ -106,13 +107,21 @@ class BaseRedisCache(BaseCache):
try
:
return
int
(
_pickle_version
)
except
(
ValueError
,
TypeError
):
raise
ImproperlyConfigured
(
"pickle version value must be an integer"
)
raise
ImproperlyConfigured
(
"pickle version value must be an integer"
)
def
get_socket_timeout
(
self
):
return
self
.
options
.
get
(
'SOCKET_TIMEOUT'
,
None
)
def
get_socket_connect_timeout
(
self
):
return
self
.
options
.
get
(
'SOCKET_CONNECT_TIMEOUT'
,
None
)
def
get_connection_pool_class
(
self
):
pool_class
=
self
.
options
.
get
(
'CONNECTION_POOL_CLASS'
,
'redis.ConnectionPool'
)
pool_class
=
self
.
options
.
get
(
'CONNECTION_POOL_CLASS'
,
'redis.ConnectionPool'
)
return
import_class
(
pool_class
)
def
get_connection_pool_class_kwargs
(
self
):
...
...
@@ -160,6 +169,7 @@ class BaseRedisCache(BaseCache):
db
=
self
.
db
,
password
=
self
.
password
,
socket_timeout
=
self
.
socket_timeout
,
socket_connect_timeout
=
self
.
socket_connect_timeout
,
)
client
=
redis
.
Redis
(
**
kwargs
)
kwargs
.
update
(
...
...
redis_cache/connection.py
View file @
6ec2fd72
...
...
@@ -31,6 +31,7 @@ class CacheConnectionPool(object):
connection_pool_class
=
None
,
connection_pool_class_kwargs
=
None
,
socket_timeout
=
None
,
socket_connect_timeout
=
None
,
**
kwargs
):
connection_identifier
=
(
host
,
port
,
db
,
unix_socket_path
)
...
...
@@ -51,6 +52,10 @@ class CacheConnectionPool(object):
'parser_class'
:
parser_class
,
'socket_timeout'
:
socket_timeout
,
}
if
not
issubclass
(
connection_class
,
UnixDomainSocketConnection
):
kwargs
[
'socket_connect_timeout'
]
=
socket_connect_timeout
kwargs
.
update
(
connection_pool_class_kwargs
)
if
unix_socket_path
is
None
:
...
...
setup.py
View file @
6ec2fd72
...
...
@@ -5,7 +5,7 @@ setup(
url
=
"http://github.com/sebleier/django-redis-cache/"
,
author
=
"Sean Bleier"
,
author_email
=
"sebleier@gmail.com"
,
version
=
"1.5.
1
"
,
version
=
"1.5.
2
"
,
packages
=
[
"redis_cache"
,
"redis_cache.backends"
],
description
=
"Redis Cache Backend for Django"
,
install_requires
=
[
'redis>=2.10.3'
],
...
...
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