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
17d8ab6c
Commit
17d8ab6c
authored
May 16, 2012
by
Sean Bleier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/mucca/django-redis-cache
parents
dc63e942
ab084443
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
cache.py
redis_cache/cache.py
+7
-4
No files found.
redis_cache/cache.py
View file @
17d8ab6c
...
...
@@ -38,12 +38,15 @@ class CacheKey(object):
class
CacheConnectionPool
(
object
):
_connection_pool
=
None
def
__init__
(
self
):
self
.
_connection_pools
=
{}
def
get_connection_pool
(
self
,
host
=
'127.0.0.1'
,
port
=
6379
,
db
=
1
,
password
=
None
,
parser_class
=
None
,
unix_socket_path
=
None
):
if
self
.
_connection_pool
is
None
:
connection_identifier
=
(
host
,
port
,
db
,
parser_class
,
unix_socket_path
)
if
not
self
.
_connection_pools
.
get
(
connection_identifier
):
connection_class
=
(
unix_socket_path
and
UnixDomainSocketConnection
or
Connection
)
...
...
@@ -60,8 +63,8 @@ class CacheConnectionPool(object):
})
else
:
kwargs
[
'path'
]
=
unix_socket_path
self
.
_connection_pool
=
redis
.
ConnectionPool
(
**
kwargs
)
return
self
.
_connection_pool
self
.
_connection_pool
s
[
connection_identifier
]
=
redis
.
ConnectionPool
(
**
kwargs
)
return
self
.
_connection_pool
s
[
connection_identifier
]
pool
=
CacheConnectionPool
()
...
...
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