Mercurial > public > src > rhodecode
annotate celeryconfig.py @ 581:53aa1ee1af86
updated tests for new version 6char password etc...
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 01 Oct 2010 02:04:32 +0200 |
parents | d945c95ba4ac |
children | 72778dda34cf |
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 |
581
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
559
diff
changeset
|
7 PYLONS_CONFIG_NAME = 'test.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'] |
537
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
19 CELERY_RESULT_SERIALIZER = 'json' |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
20 |
510
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 |
518
a3d9d24acbec
Implemented password reset(forms/models/ tasks) and mailing tasks.
Marcin Kuzminski <marcin@python-works.com>
parents:
510
diff
changeset
|
22 BROKER_CONNECTION_MAX_RETRIES = 30 |
510
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 ## Broker settings. |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 BROKER_HOST = "localhost" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 BROKER_PORT = 5672 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 BROKER_VHOST = "rabbitmqhost" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
28 BROKER_USER = "rabbitmq" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 BROKER_PASSWORD = "qweqwe" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
30 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
31 ## Worker settings |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
32 ## 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
|
33 ## 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
|
34 ## 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
|
35 ## available will be used. |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 CELERYD_CONCURRENCY = 2 |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
37 # CELERYD_LOG_FILE = "celeryd.log" |
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
38 CELERYD_LOG_LEVEL = "DEBUG" |
551
d5efb83590ef
fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!
Marcin Kuzminski <marcin@python-works.com>
parents:
537
diff
changeset
|
39 CELERYD_MAX_TASKS_PER_CHILD = 3 |
510
3fc3ce53659b
starting celery branch
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 |
537
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
41 #Tasks will never be sent to the queue, but executed locally instead. |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
42 CELERY_ALWAYS_EAGER = False |
581
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
559
diff
changeset
|
43 if PYLONS_CONFIG_NAME == 'test.ini': |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
559
diff
changeset
|
44 #auto eager for tests |
53aa1ee1af86
updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents:
559
diff
changeset
|
45 CELERY_ALWAYS_EAGER = True |
537
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
46 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
47 #=============================================================================== |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
48 # EMAIL SETTINGS |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
49 #=============================================================================== |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
50 pylons_email_config = dict(config.items('DEFAULT')) |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
51 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
52 CELERY_SEND_TASK_ERROR_EMAILS = True |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
53 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
54 #List of (name, email_address) tuples for the admins that should receive error e-mails. |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
55 ADMINS = [('Administrator', pylons_email_config.get('email_to'))] |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
56 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
57 #The e-mail address this worker sends e-mails from. Default is "celery@localhost". |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
58 SERVER_EMAIL = pylons_email_config.get('error_email_from') |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
59 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
60 #The mail server to use. Default is "localhost". |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
61 MAIL_HOST = pylons_email_config.get('smtp_server') |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
62 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
63 #Username (if required) to log on to the mail server with. |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
64 MAIL_HOST_USER = pylons_email_config.get('smtp_username') |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
65 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
66 #Password (if required) to log on to the mail server with. |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
67 MAIL_HOST_PASSWORD = pylons_email_config.get('smtp_password') |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
68 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
69 MAIL_PORT = pylons_email_config.get('smtp_port') |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
70 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
71 |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
72 #=============================================================================== |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
73 # INSTRUCTIONS FOR RABBITMQ |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
74 #=============================================================================== |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
75 # rabbitmqctl add_user rabbitmq qweqwe |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
76 # rabbitmqctl add_vhost rabbitmqhost |
2256c78afe53
implemented basic autoupdating statistics fetched from database
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
77 # rabbitmqctl set_permissions -p rabbitmqhost rabbitmq ".*" ".*" ".*" |