{"action":"created","issue":{"url":"https://api.github.com/repos/celery/celery/issues/3050","repository_url":"https://api.github.com/repos/celery/celery","labels_url":"https://api.github.com/repos/celery/celery/issues/3050/labels{/name}","comments_url":"https://api.github.com/repos/celery/celery/issues/3050/comments","events_url":"https://api.github.com/repos/celery/celery/issues/3050/events","html_url":"https://github.com/celery/celery/issues/3050","id":133181976,"number":3050,"title":"celery worker no command line option for setting result backend","user":{"login":"asmodehn","id":221256,"avatar_url":"https://avatars.githubusercontent.com/u/221256?v=3","gravatar_id":"","url":"https://api.github.com/users/asmodehn","html_url":"https://github.com/asmodehn","followers_url":"https://api.github.com/users/asmodehn/followers","following_url":"https://api.github.com/users/asmodehn/following{/other_user}","gists_url":"https://api.github.com/users/asmodehn/gists{/gist_id}","starred_url":"https://api.github.com/users/asmodehn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmodehn/subscriptions","organizations_url":"https://api.github.com/users/asmodehn/orgs","repos_url":"https://api.github.com/users/asmodehn/repos","events_url":"https://api.github.com/users/asmodehn/events{/privacy}","received_events_url":"https://api.github.com/users/asmodehn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-12T08:11:53Z","updated_at":"2016-02-15T05:51:10Z","closed_at":null,"body":"With celery 3.1.20 I get : \r\n```\r\n(celery)alexv@asmodehn:~/Projects$ celery worker --help\r\nUsage: celery worker [options] \r\n\r\nStart worker instance.\r\n\r\nExamples::\r\n\r\n    celery worker --app=proj -l info\r\n    celery worker -A proj -l info -Q hipri,lopri\r\n\r\n    celery worker -A proj --concurrency=4\r\n    celery worker -A proj --concurrency=1000 -P eventlet\r\n\r\n    celery worker --autoscale=10,0\r\n\r\nOptions:\r\n  -A APP, --app=APP     app instance to use (e.g. module.attr_name)\r\n  -b BROKER, --broker=BROKER\r\n                        url to broker.  default is 'amqp://guest@localhost//'\r\n  --loader=LOADER       name of custom loader class to use.\r\n  --config=CONFIG       Name of the configuration module\r\n  --workdir=WORKING_DIRECTORY\r\n                        Optional directory to change to after detaching.\r\n  -C, --no-color        \r\n  -q, --quiet           \r\n  -c CONCURRENCY, --concurrency=CONCURRENCY\r\n                        Number of child processes processing the queue. The\r\n                        default is the number of CPUs available on your\r\n                        system.\r\n  -P POOL_CLS, --pool=POOL_CLS\r\n                        Pool implementation: prefork (default), eventlet,\r\n                        gevent, solo or threads.\r\n  --purge, --discard    Purges all waiting tasks before the daemon is started.\r\n                        **WARNING**: This is unrecoverable, and the tasks will\r\n                        be deleted from the messaging server.\r\n  -l LOGLEVEL, --loglevel=LOGLEVEL\r\n                        Logging level, choose between DEBUG, INFO, WARNING,\r\n                        ERROR, CRITICAL, or FATAL.\r\n  -n HOSTNAME, --hostname=HOSTNAME\r\n                        Set custom hostname, e.g. 'w1.%h'. Expands: %h\r\n                        (hostname), %n (name) and %d, (domain).\r\n  -B, --beat            Also run the celery beat periodic task scheduler.\r\n                        Please note that there must only be one instance of\r\n                        this service.\r\n  -s SCHEDULE_FILENAME, --schedule=SCHEDULE_FILENAME\r\n                        Path to the schedule database if running with the -B\r\n                        option. Defaults to celerybeat-schedule. The extension\r\n                        \".db\" may be appended to the filename. Apply\r\n                        optimization profile.  Supported: default, fair\r\n  --scheduler=SCHEDULER_CLS\r\n                        Scheduler class to use. Default is\r\n                        celery.beat.PersistentScheduler\r\n  -S STATE_DB, --statedb=STATE_DB\r\n                        Path to the state database. The extension '.db' may be\r\n                        appended to the filename. Default: None\r\n  -E, --events          Send events that can be captured by monitors like\r\n                        celery events, celerymon, and others.\r\n  --time-limit=TASK_TIME_LIMIT\r\n                        Enables a hard time limit (in seconds int/float) for\r\n                        tasks.\r\n  --soft-time-limit=TASK_SOFT_TIME_LIMIT\r\n                        Enables a soft time limit (in seconds int/float) for\r\n                        tasks.\r\n  --maxtasksperchild=MAX_TASKS_PER_CHILD\r\n                        Maximum number of tasks a pool worker can execute\r\n                        before it's terminated and replaced by a new worker.\r\n  -Q QUEUES, --queues=QUEUES\r\n                        List of queues to enable for this worker, separated by\r\n                        comma. By default all configured queues are enabled.\r\n                        Example: -Q video,image\r\n  -X EXCLUDE_QUEUES, --exclude-queues=EXCLUDE_QUEUES\r\n  -I INCLUDE, --include=INCLUDE\r\n                        Comma separated list of additional modules to import.\r\n                        Example: -I foo.tasks,bar.tasks\r\n  --autoscale=AUTOSCALE\r\n                        Enable autoscaling by providing max_concurrency,\r\n                        min_concurrency. Example:: --autoscale=10,3 (always\r\n                        keep 3 processes, but grow to 10 if necessary)\r\n  --autoreload          Enable autoreloading.\r\n  --no-execv            Don't do execv after multiprocessing child fork.\r\n  --without-gossip      Do not subscribe to other workers events.\r\n  --without-mingle      Do not synchronize with other workers at startup.\r\n  --without-heartbeat   Do not send event heartbeats.\r\n  --heartbeat-interval=HEARTBEAT_INTERVAL\r\n                        Interval in seconds at which to send worker heartbeat\r\n  -O OPTIMIZATION       \r\n  -D, --detach          \r\n  -f LOGFILE, --logfile=LOGFILE\r\n                        Path to log file. If no logfile is specified, stderr\r\n                        is used.\r\n  --pidfile=PIDFILE     Optional file used to store the process pid. The\r\n                        program will not start if this file already exists and\r\n                        the pid is still alive.\r\n  --uid=UID             User id, or user name of the user to run as after\r\n                        detaching.\r\n  --gid=GID             Group id, or group name of the main group to change to\r\n                        after detaching.\r\n  --umask=UMASK         Effective umask (in octal) of the process after\r\n                        detaching.  Inherits the umask of the parent process\r\n                        by default.\r\n  --executable=EXECUTABLE\r\n                        Executable to use for the detached process.\r\n  --version             show program's version number and exit\r\n  -h, --help            show this help message and exit\r\n```\r\nI do not see how I can set the result database.\r\n\r\nIn config file I have : \r\n```\r\nBROKER_URL = 'redis://localhost:6379'\r\nCELERY_RESULT_BACKEND = BROKER_URL\r\n```\r\nThen starting the worker I can pass `--broker=redis://another-host:6379`\r\nBut I cannot find anyway to change the result backend to override the configuration setting...\r\n\r\nAm I missing something ?"},"comment":{"url":"https://api.github.com/repos/celery/celery/issues/comments/184074652","html_url":"https://github.com/celery/celery/issues/3050#issuecomment-184074652","issue_url":"https://api.github.com/repos/celery/celery/issues/3050","id":184074652,"user":{"login":"asmodehn","id":221256,"avatar_url":"https://avatars.githubusercontent.com/u/221256?v=3","gravatar_id":"","url":"https://api.github.com/users/asmodehn","html_url":"https://github.com/asmodehn","followers_url":"https://api.github.com/users/asmodehn/followers","following_url":"https://api.github.com/users/asmodehn/following{/other_user}","gists_url":"https://api.github.com/users/asmodehn/gists{/gist_id}","starred_url":"https://api.github.com/users/asmodehn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmodehn/subscriptions","organizations_url":"https://api.github.com/users/asmodehn/orgs","repos_url":"https://api.github.com/users/asmodehn/repos","events_url":"https://api.github.com/users/asmodehn/events{/privacy}","received_events_url":"https://api.github.com/users/asmodehn/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T05:51:10Z","updated_at":"2016-02-15T05:51:10Z","body":"In addition, it seems to me that the BROKER_URL value from the config module is not used when using `--config` command line option to start the worker... not sure if it s related or not ( or maybe just because I don't really get how configuration is working ?)\r\n\r\nI have been trying to extend/specialize/wrap celery (https://github.com/asmodehn/celeros), but the way to configure it on runtime is still not clear to me..."}}