cleanup_dead_jobs() , active jobs, empty case not handled#277
Closed
smallzhao wants to merge 2 commits into
Closed
cleanup_dead_jobs() , active jobs, empty case not handled#277smallzhao wants to merge 2 commits into
smallzhao wants to merge 2 commits into
Conversation
added 2 commits
May 7, 2019 11:21
| inspect = celery_app.control.inspect() | ||
| active_tasks = {task['id'] for worker, tasks in six.iteritems(inspect.active()) for task in tasks} | ||
| task_infos = inspect.active() | ||
| if task_infos == None: |
Contributor
There was a problem hiding this comment.
It might be worth having this line as if task_infos is None: according to https://stackoverflow.com/questions/14247373/python-none-comparison-should-i-use-is-or
Chris7
reviewed
May 24, 2019
Member
Chris7
left a comment
There was a problem hiding this comment.
Thank you for taking this on! I have one comment about a better name and simplifying the None check.
| # Get active tasks from Celery | ||
| inspect = celery_app.control.inspect() | ||
| active_tasks = {task['id'] for worker, tasks in six.iteritems(inspect.active()) for task in tasks} | ||
| task_infos = inspect.active() |
Member
There was a problem hiding this comment.
Could you call this worker_info? I think you can also achieve the None check here by doing:
worker_info = inspect.active() or {}
This was referenced Jun 5, 2019
Closed
Member
|
Thanks for this patch, I implemented it in #281 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue #261