##// END OF EJS Templates
fixed up celeryconfig, to get results database from config files
marcink -
r484:d3f701d9 celery
parent child Browse files
Show More
@@ -1,45 +1,42 b''
1 # List of modules to import when celery starts.
1 # List of modules to import when celery starts.
2 import sys
2 import sys
3 import os
3 import os
4 import ConfigParser
4 import ConfigParser
5 root = os.getcwd()
5
6
6 PYLONS_CONFIG_NAME = 'test.ini'
7 PYLONS_CONFIG_NAME = 'development.ini'
7
8
8 root = os.getcwd()
9 sys.path.append(root)
9 config = ConfigParser.ConfigParser({'here':root})
10 config = ConfigParser.ConfigParser({'here':root})
10 config.read('%s/%s' % (root, PYLONS_CONFIG_NAME))
11 config.read('%s/%s' % (root, PYLONS_CONFIG_NAME))
11 PYLONS_CONFIG = config
12 PYLONS_CONFIG = config
12
13
13
14 print config.items('app:main')
15
16 sys.path.append(os.getcwd())
17 CELERY_IMPORTS = ("pylons_app.lib.celerylib.tasks",)
14 CELERY_IMPORTS = ("pylons_app.lib.celerylib.tasks",)
18
15
19 ## Result store settings.
16 ## Result store settings.
20 CELERY_RESULT_BACKEND = "database"
17 CELERY_RESULT_BACKEND = "database"
21 CELERY_RESULT_DBURI = "sqlite:///hg_app.db"
18 CELERY_RESULT_DBURI = dict(config.items('app:main'))['sqlalchemy.db1.url']
22
19
23 BROKER_CONNECTION_MAX_RETRIES = 30
20 BROKER_CONNECTION_MAX_RETRIES = 30
24
21
25 ## Broker settings.
22 ## Broker settings.
26 BROKER_HOST = "localhost"
23 BROKER_HOST = "localhost"
27 BROKER_PORT = 5672
24 BROKER_PORT = 5672
28 BROKER_VHOST = "rabbitmqhost"
25 BROKER_VHOST = "rabbitmqhost"
29 BROKER_USER = "rabbitmq"
26 BROKER_USER = "rabbitmq"
30 BROKER_PASSWORD = "qweqwe"
27 BROKER_PASSWORD = "qweqwe"
31
28
32 ## Worker settings
29 ## Worker settings
33 ## If you're doing mostly I/O you can have more processes,
30 ## If you're doing mostly I/O you can have more processes,
34 ## but if mostly spending CPU, try to keep it close to the
31 ## but if mostly spending CPU, try to keep it close to the
35 ## number of CPUs on your machine. If not set, the number of CPUs/cores
32 ## number of CPUs on your machine. If not set, the number of CPUs/cores
36 ## available will be used.
33 ## available will be used.
37 CELERYD_CONCURRENCY = 2
34 CELERYD_CONCURRENCY = 2
38 # CELERYD_LOG_FILE = "celeryd.log"
35 # CELERYD_LOG_FILE = "celeryd.log"
39 CELERYD_LOG_LEVEL = "DEBUG"
36 CELERYD_LOG_LEVEL = "DEBUG"
40 CELERYD_MAX_TASKS_PER_CHILD = 1
37 CELERYD_MAX_TASKS_PER_CHILD = 1
41
38
42 #CELERY_ALWAYS_EAGER = True
39 #CELERY_ALWAYS_EAGER = True
43 #rabbitmqctl add_user rabbitmq qweqwe
40 #rabbitmqctl add_user rabbitmq qweqwe
44 #rabbitmqctl add_vhost rabbitmqhost
41 #rabbitmqctl add_vhost rabbitmqhost
45 #rabbitmqctl set_permissions -p rabbitmqhost rabbitmq ".*" ".*" ".*"
42 #rabbitmqctl set_permissions -p rabbitmqhost rabbitmq ".*" ".*" ".*"
General Comments 0
You need to be logged in to leave comments. Login now