Ejemplo n.º 1
0
def worker(tasks, send_devs):
    '''
    下发
    '''
    try:

        logger.debug('---worker begin----')
        logger.debug('---worker send_devs len is %s----' % (len(send_devs)))
        results = send(send_devs, tasks)
        update_db_dev(tasks[0]['dev_id'], results)
        #subsenter
        faild_list = get_failed_cert_devs(tasks[0].get("dev_id"), results,
                                          'cert_query_dev')
        logger.debug('---worker subsenter faild_list len %s----' %
                     (len(faild_list)))

        if faild_list:
            Interface = 'checkcertisexits'
            link_detection_cert.delay(tasks, faild_list, Interface)

        #check_cert_task
        logger.debug('cert_query trans worker begin check delay')
        check_cert_query_task.apply_async(([i['_id'] for i in tasks], ),
                                          countdown=120)
        logger.debug('cert_query trans worker begin end check delay')

        #make_all_callback_force([i['_id'] for i in tasks])

    except Exception, e:

        #make_all_callback_force([i['_id'] for i in tasks])
        logger.debug('cert_query trans worker error is %s' %
                     (traceback.format_exc(e)))
Ejemplo n.º 2
0
def worker(tasks, send_devs):
    '''
    下发
    '''
    try:

        logger.debug('---worker begin----')
        logger.debug('---worker send_devs len is %s----' % (len(send_devs)))
        results = send(send_devs, tasks)
        update_db_dev(tasks[0].get("dev_id"), results)
        # subsenter
        faild_list = get_failed_cert_devs(tasks[0].get("dev_id"), results,
                                          'cert_trans_dev')
        logger.debug('---worker subsenter faild_list len %s----' %
                     (len(faild_list)))

        if faild_list:
            link_detection_cert.delay(tasks, faild_list)

        # check_cert_task
        check_cert_task.apply_async(([i['_id'] for i in tasks], ),
                                    countdown=180)

        make_all_callback_force([i['_id'] for i in tasks])

    except Exception:

        #make_all_callback_force([i['_id'] for i in tasks])
        logger.debug('cert trans worker error is %s' %
                     (traceback.format_exc()))