Пример #1
0
def pull_all_stat_res(stat, redis_conn=None):
    '''Pulls all stat results
    '''
    if redis_conn is None:
        redis_conn = get_redis(CFG['QUEUE_REDIS'])
    queue = Queue('calc', connection=redis_conn)
    job = queue.fetch_job(COLL_ID_FMT % stat)

    res = None
    if job is None:
        return
    res = job.result
    if res is None:
        return

    out = []
    for stat_token in res:
        _job = queue.fetch_job(to_str(stat_token))
        _res = None
        if _job is not None:
            _res = _job.result
        if _res is not None:
            out.append(_res)

    return out
Пример #2
0
def pull_all_stat_res(stat, redis_conn=None):
    '''Pulls all stat results
    '''
    if redis_conn is None:
        redis_conn = get_redis(CFG['QUEUE_REDIS'])
    queue = Queue('calc', connection=redis_conn)
    job = queue.fetch_job(COLL_ID_FMT % stat)

    res = None
    if job is None:
        return
    res = job.result
    if res is None:
        return

    out = []
    for stat_token in res:
        _job = queue.fetch_job(to_str(stat_token))
        _res = None
        if _job is not None:
            _res = _job.result
        if _res is not None:
            out.append(_res)

    return out
Пример #3
0
 def test_to_str():
     assert utils.to_str('abc') == 'abc'
Пример #4
0
 def test_to_str():
     assert utils.to_str('abc') == 'abc'