Skip to content

Commit

Permalink
clean up the concurrency option too stop passing other args
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jul 20, 2012
1 parent a17c5f4 commit 7c8d450
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckan/lib/cli.py
Expand Up @@ -781,11 +781,12 @@ class Celery(CkanCommand):
Usage:
celeryd - run the celery daemon
celeryd run - run the celery daemon
celeryd run concurrency=1 - run the celery daemon with argument 'concurrency'
celeryd run concurrency - run the celery daemon with argument 'concurrency'
celeryd view - view all tasks in the queue
celeryd clean - delete all tasks in the queue
'''
min_args = 0
max_args = 2
summary = __doc__.split('\n')[0]
usage = __doc__

Expand All @@ -807,7 +808,9 @@ def command(self):
def run_(self):
os.environ['CKAN_CONFIG'] = os.path.abspath(self.options.config)
from ckan.lib.celery_app import celery
celery_args = ['--%s' % arg for arg in self.args[1:]]
celery_args = []
if len(self.args) == 2 and self.args[1] == 'concurrency':
celery_args.append['--concurrency=1']
celery.worker_main(argv=['celeryd', '--loglevel=INFO'] + celery_args)

def view(self):
Expand Down

4 comments on commit 7c8d450

@davidread
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a step backwards. What other args?

@tobes
Copy link
Contributor Author

@tobes tobes commented on 7c8d450 Jul 23, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidread

how about

paster celeryd run purge

if this is what was wanted then the commit message was not very good

@davidread
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My commit message was "Add cli param to allow options to be passed to celery daemon (e.g. concurrency limit)." I think that is pretty clear what the purpose of the change is. I don't understand why you've limited the args passed to just one particular one with one particular value. Your commit message did not state your reasoning for a damaging change. Please explain or revert.

@tobes
Copy link
Contributor Author

@tobes tobes commented on 7c8d450 Jul 24, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok fair point however the paster documentation is incorrect

Please sign in to comment.