Mercurial > public > src > rhodecode
annotate celeryconfig.py @ 528:d3f701d912bd celery
fixed up celeryconfig, to get results database from config files
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 17 Sep 2010 23:57:22 +0200 |
parents | a9e50dce3081 |
children | 2256c78afe53 |
rev | line source |
---|---|
510
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 # List of modules to import when celery starts. |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 import sys |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 import os |
527
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
4 import ConfigParser |
528
d3f701d912bd
fixed up celeryconfig, to get results database from config files
Marcin Kuzminski <marcin@python-works.com>
parents:
527
diff
changeset
|
5 root = os.getcwd() |
527
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
6 |
528
d3f701d912bd
fixed up celeryconfig, to get results database from config files
Marcin Kuzminski <marcin@python-works.com>
parents:
527
diff
changeset
|
7 PYLONS_CONFIG_NAME = 'development.ini' |
527
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
8 |
528
d3f701d912bd
fixed up celeryconfig, to get results database from config files
Marcin Kuzminski <marcin@python-works.com>
parents:
527
diff
changeset
|
9 sys.path.append(root) |
527
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
10 config = ConfigParser.ConfigParser({'here':root}) |
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
11 config.read('%s/%s' % (root, PYLONS_CONFIG_NAME)) |
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
12 PYLONS_CONFIG = config |
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
13 |
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
14 CELERY_IMPORTS = ("pylons_app.lib.celerylib.tasks",) |
510
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 ## Result store settings. |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 CELERY_RESULT_BACKEND = "database" |
528
d3f701d912bd
fixed up celeryconfig, to get results database from config files
Marcin Kuzminski <marcin@python-works.com>
parents:
527
diff
changeset
|
18 CELERY_RESULT_DBURI = dict(config.items('app:main'))['sqlalchemy.db1.url'] |
510
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 |
518
a3d9d24acbec
Implemented password reset(forms/models/ tasks) and mailing tasks.
Marcin Kuzminski <marcin@python-works.com>
parents:
510
diff
changeset
|
20 BROKER_CONNECTION_MAX_RETRIES = 30 |
510
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 ## Broker settings. |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 BROKER_HOST = "localhost" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 BROKER_PORT = 5672 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 BROKER_VHOST = "rabbitmqhost" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 BROKER_USER = "rabbitmq" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 BROKER_PASSWORD = "qweqwe" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
28 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 ## Worker settings |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
30 ## If you're doing mostly I/O you can have more processes, |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
31 ## but if mostly spending CPU, try to keep it close to the |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
32 ## number of CPUs on your machine. If not set, the number of CPUs/cores |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
33 ## available will be used. |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
34 CELERYD_CONCURRENCY = 2 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
35 # CELERYD_LOG_FILE = "celeryd.log" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 CELERYD_LOG_LEVEL = "DEBUG" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
37 CELERYD_MAX_TASKS_PER_CHILD = 1 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
38 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
39 #CELERY_ALWAYS_EAGER = True |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 #rabbitmqctl add_user rabbitmq qweqwe |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
41 #rabbitmqctl add_vhost rabbitmqhost |
527
a9e50dce3081
Removed config names from whoosh and celery,
Marcin Kuzminski <marcin@python-works.com>
parents:
518
diff
changeset
|
42 #rabbitmqctl set_permissions -p rabbitmqhost rabbitmq ".*" ".*" ".*" |