예제 #1
0
def patch_map(workspace, mapname, task_options, start_at):
    # sync processing
    sources = get_sources()
    call_modules_fn(sources, 'patch_map', [workspace, mapname], kwargs=task_options)

    # async processing
    patch_tasks = tasks_util.get_task_methods(get_map_type_def(), workspace, mapname, task_options, start_at)
    patch_chain = tasks_util.get_chain_of_methods(workspace, mapname, patch_tasks, task_options, 'mapname')
    # res = patch_chain.apply_async()
    res = patch_chain()

    celery_util.set_publication_chain_info(workspace, MAP_TYPE, mapname, patch_tasks, res)
예제 #2
0
파일: util.py 프로젝트: index-git/layman
def post_layer(workspace, layername, task_options, start_async_at):
    # sync processing
    sources = get_sources()
    call_modules_fn(sources,
                    'post_layer', [workspace, layername],
                    kwargs=task_options)

    post_tasks = tasks_util.get_task_methods(get_layer_type_def(), workspace,
                                             layername, task_options,
                                             start_async_at)
    post_chain = tasks_util.get_chain_of_methods(workspace, layername,
                                                 post_tasks, task_options,
                                                 'layername')
    # res = post_chain.apply_async()
    res = post_chain()

    celery_util.set_publication_chain_info(workspace, LAYER_TYPE, layername,
                                           post_tasks, res)
예제 #3
0
파일: util.py 프로젝트: index-git/layman
def patch_layer(workspace, layername, task_options, stop_sync_at,
                start_async_at):
    # sync processing
    sources = get_sources()
    stop_idx = next(
        (idx for idx, s in enumerate(sources) if s.__name__ == stop_sync_at),
        len(sources))
    sources = sources[:stop_idx]
    call_modules_fn(sources,
                    'patch_layer', [workspace, layername],
                    kwargs=task_options)

    patch_tasks = tasks_util.get_task_methods(get_layer_type_def(), workspace,
                                              layername, task_options,
                                              start_async_at)
    patch_chain = tasks_util.get_chain_of_methods(workspace, layername,
                                                  patch_tasks, task_options,
                                                  'layername')
    # res = patch_chain.apply_async()
    res = patch_chain()

    celery_util.set_publication_chain_info(workspace, LAYER_TYPE, layername,
                                           patch_tasks, res)