Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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):
active_queues
=
get_queues
()
if
active_queues
is
None
:
return
False
# v is List of List of queues dict
node_workers
=
[
v
for
k
,
v
in
active_queues
.
iteritems
()]
for
worker
in
node_workers
:
for
queue
in
worker
:
if
queue
[
'name'
]
==
queue_name
:
return
True
return
False
queue_names
=
(
queue
[
'name'
]
for
worker
in
active_queues
.
itervalues
()
for
queue
in
worker
)
return
queue_name
in
queue_names
def
get_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!
"""
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