Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
de7cb13e
authored
Apr 10, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: refactor check_queue task
parent
6636656e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
circle/vm/tasks/vm_tasks.py
+5
-7
No files found.
circle/vm/tasks/vm_tasks.py
View file @
de7cb13e
...
@@ -19,18 +19,16 @@ def check_queue(node_hostname, queue_id):
...
@@ -19,18 +19,16 @@ def check_queue(node_hostname, queue_id):
active_queues
=
get_queues
()
active_queues
=
get_queues
()
if
active_queues
is
None
:
if
active_queues
is
None
:
return
False
return
False
# v is List of List of queues dict
queue_names
=
(
queue
[
'name'
]
for
worker
in
active_queues
.
itervalues
()
node_workers
=
[
v
for
k
,
v
in
active_queues
.
iteritems
()]
for
queue
in
worker
)
for
worker
in
node_workers
:
return
queue_name
in
queue_names
for
queue
in
worker
:
if
queue
[
'name'
]
==
queue_name
:
return
True
return
False
def
get_queues
():
def
get_queues
():
"""Get active celery queues.
"""Get active celery queues.
Returns a dictionary whose entries are (worker name;list of queues) pairs,
where queues are represented by dictionaries.
Result is cached for 10 seconds!
Result is cached for 10 seconds!
"""
"""
key
=
__name__
+
u'queues'
key
=
__name__
+
u'queues'
...
...
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