Esempio n. 1
0
def xdcrConsumer(xdcrQueue = "xdcr_tasks"):

    rabbitHelper = xdcrConsumer.rabbitHelper
    try:
        xdcrQueueSize = rabbitHelper.qsize(xdcrQueue)
        if xdcrQueueSize > 0:
            xdcrMsg = rabbitHelper.getJsonMsg(xdcrQueue)
            logger.error(xdcrMsg)
            perform_xdcr_tasks.apply_async(args=[xdcrMsg])

    except Exception as ex:
        logger.error(ex)
Esempio n. 2
0
def xdcrConsumer(xdcrQueue = "xdcr_default"):

    rabbitHelper = xdcrConsumer.rabbitHelper

    try:
        xdcrQueueSize = rabbitHelper.qsize(xdcrQueue)
        if xdcrQueueSize > 0:
            xdcrMsg = rabbitHelper.getJsonMsg(xdcrQueue)
            logger.error(xdcrMsg)
            perform_xdcr_tasks.apply_async(args=[xdcrMsg])
            if 'rcq' in xdcrMsg:
                rabbitHelper.putMsg(xdcrMsg['rcq'], "Started xdcr task: %s" % xdcrMsg)

    except Exception as ex:
        logger.error(ex)
Esempio n. 3
0
def xdcrConsumer(xdcrQueue="xdcr_default"):

    rabbitHelper = xdcrConsumer.rabbitHelper

    try:
        xdcrQueueSize = rabbitHelper.qsize(xdcrQueue)
        if xdcrQueueSize > 0:
            xdcrMsg = rabbitHelper.getJsonMsg(xdcrQueue)
            logger.error(xdcrMsg)
            perform_xdcr_tasks.apply_async(args=[xdcrMsg])
            if 'rcq' in xdcrMsg:
                rabbitHelper.putMsg(xdcrMsg['rcq'],
                                    "Started xdcr task: %s" % xdcrMsg)

    except Exception as ex:
        logger.error(ex)