Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
celery_len_monitor
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
system
celery_len_monitor
Commits
9fdc8277
Commit
9fdc8277
authored
Apr 23, 2019
by
胡凯旋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redis auth
parent
28b4574d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
main.py
main.py
+2
-2
settings.py
settings.py
+2
-2
No files found.
main.py
View file @
9fdc8277
...
...
@@ -12,10 +12,10 @@ import settings
class
Monitor
(
object
):
def
__init__
(
self
):
self
.
rs
=
{
redis_url
:
redis
.
StrictRedis
(
*
redis_url
.
split
(
':'
))
for
redis_url
in
settings
.
REDIS_URL
}
self
.
rs
=
{
"{}:{}/{}"
.
format
(
r
[
'host'
],
r
[
'port'
],
r
[
'db'
]):
redis
.
StrictRedis
(
**
r
)
for
r
in
settings
.
REDIS
}
self
.
keyprefix_queue
=
'_kombu.binding.'
self
.
sep
=
'
\x06\x16
'
self
.
redis_queue_map
=
{
redis_url
:
[]
for
redis_url
in
settings
.
REDIS_URL
}
self
.
redis_queue_map
=
{
"{}:{}/{}"
.
format
(
r
[
'host'
],
r
[
'port'
],
r
[
'db'
]):
[]
for
r
in
settings
.
REDIS
}
def
refresh_redis_queue_map
(
self
):
for
url
,
r
in
self
.
rs
.
items
():
...
...
settings.py
View file @
9fdc8277
...
...
@@ -3,8 +3,8 @@
"""
# redis URL
REDIS
_URL
=
[
'localhost'
,
REDIS
=
[
{
'host'
:
'localhost'
,
'port'
:
6379
,
'db'
:
2
,
'password'
:
'secret'
}
,
]
# pushgateway URL
...
...
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