예제 #1
0
 def setUpClass(cls):
     path = osp.splitext(__file__)[0] + '.yml'
     with open(path) as istr:
         raw_config = yaml.load(istr)
     config = {
         'cache': raw_config['backache']['mongo'],
         'resource': raw_config['backache']['redis'],
         'celery': raw_config['backache']['celery'],
         'celery_app': celery,
     }
     celery.config_from_object(raw_config['celery'])
     cls.backache = backache.celerize(**config)
     cls.backache._config.operations['foo'] = cls.operation
예제 #2
0
 def setUpClass(cls):
     path = osp.splitext(__file__)[0] + '.yml'
     with open(path) as istr:
         raw_config = yaml.load(istr)
     config = {
         'cache': raw_config['backache']['mongo'],
         'resource': raw_config['backache']['redis'],
         'celery': raw_config['backache']['celery'],
         'callbacks': {
             'default': cls.callback.process,
         },
         'celery_app': celery,
     }
     celery.config_from_object(raw_config['celery'])
     cls.backache = backache.celerize(**config)
예제 #3
0
 def _backache(cls, with_celery=False):
     if with_celery:
         return backache.celerize(**cls.backache_config)
     else:
         return backache.Backache(**cls.backache_config)