Show More
@@ -40,6 +40,7 b' from rhodecode.lib.pidlock import Daemon' | |||||
40 |
|
40 | |||
41 | from celery.messaging import establish_connection |
|
41 | from celery.messaging import establish_connection | |
42 | from pylons import config |
|
42 | from pylons import config | |
|
43 | from rhodecode.lib import celerypylons | |||
43 |
|
44 | |||
44 | log = logging.getLogger(__name__) |
|
45 | log = logging.getLogger(__name__) | |
45 |
|
46 | |||
@@ -59,17 +60,7 b' class ResultWrapper(object):' | |||||
59 | def run_task(task, *args, **kwargs): |
|
60 | def run_task(task, *args, **kwargs): | |
60 | if CELERY_ON: |
|
61 | if CELERY_ON: | |
61 | try: |
|
62 | try: | |
62 | kw = { |
|
63 | t = task.apply_async(args=args, kwargs=kwargs) | |
63 | 'hostname':config['app_conf'].get('broker.host'), |
|
|||
64 | 'userid':config['app_conf'].get('broker.user'), |
|
|||
65 | 'password':config['app_conf'].get('broker.password'), |
|
|||
66 | 'virtual_host':config['app_conf'].get('broker.vhost'), |
|
|||
67 | 'port':config['app_conf'].get('broker.port'), |
|
|||
68 | } |
|
|||
69 | conn = establish_connection(**kw) |
|
|||
70 | publisher = task.get_publisher(connection=conn) |
|
|||
71 | t = task.apply_async(args=args, kwargs=kwargs, publisher=publisher) |
|
|||
72 |
|
||||
73 | log.info('running task %s:%s', t.task_id, task) |
|
64 | log.info('running task %s:%s', t.task_id, task) | |
74 | return t |
|
65 | return t | |
75 | except socket.error, e: |
|
66 | except socket.error, e: |
General Comments 0
You need to be logged in to leave comments.
Login now