Changeset - 7fd45bf17d07
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-02-08 15:06:41
marcin@python-works.com
fixed celery issues, default loader was not set as PylonsLoader
1 file changed with 2 insertions and 11 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/celerylib/__init__.py
Show inline comments
 
@@ -40,6 +40,7 @@ from rhodecode.lib.pidlock import Daemon
 

	
 
from celery.messaging import establish_connection
 
from pylons import  config
 
from rhodecode.lib import celerypylons
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -59,17 +60,7 @@ class ResultWrapper(object):
 
def run_task(task, *args, **kwargs):
 
    if CELERY_ON:
 
        try:
 
            kw = {
 
                'hostname':config['app_conf'].get('broker.host'),
 
                'userid':config['app_conf'].get('broker.user'),
 
                'password':config['app_conf'].get('broker.password'),
 
                'virtual_host':config['app_conf'].get('broker.vhost'),
 
                'port':config['app_conf'].get('broker.port'),
 
            }
 
            conn = establish_connection(**kw)
 
            publisher = task.get_publisher(connection=conn)
 
            t = task.apply_async(args=args, kwargs=kwargs, publisher=publisher)
 

	
 
            t = task.apply_async(args=args, kwargs=kwargs)
 
            log.info('running task %s:%s', t.task_id, task)
 
            return t
 
        except socket.error, e:
0 comments (0 inline, 0 general)