Skip to content

Commit

Permalink
Make layman.util::patch_after_wfst the main and call it from layman.l…
Browse files Browse the repository at this point in the history
…ayer.util::patch_after_wfst
  • Loading branch information
index-git committed May 10, 2021
1 parent 5fa1d9a commit 887a1a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/layman/layer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,7 @@ def patch_layer(workspace, layername, task_options, stop_sync_at, start_async_at


def patch_after_wfst(workspace, layername, **kwargs):
task_methods = tasks_util.get_source_task_methods(get_layer_type_def(), 'patch_after_wfst')
patch_chain = tasks_util.get_chain_of_methods(workspace, layername, task_methods, kwargs, 'layername')
res = patch_chain()

celery_util.set_publication_chain_info(workspace, LAYER_TYPE, layername, task_methods, res)
layman_util.patch_after_wfst(workspace, LAYER_TYPE, layername, **kwargs)


def delete_layer(workspace, layername, source=None, http_method='delete'):
Expand Down
12 changes: 7 additions & 5 deletions src/layman/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from flask import current_app, request, url_for as flask_url_for, jsonify
from unidecode import unidecode

from layman import settings
from layman import settings, celery as celery_util
from layman.common import tasks as tasks_util
from layman.http import LaymanError

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -389,7 +390,8 @@ def delete_publications(user,
return jsonify(infos)


def patch_after_wfst(workspace, publication_type, layername, ):
from layman.layer import LAYER_TYPE, util as layer_util
if publication_type == LAYER_TYPE:
layer_util.patch_after_wfst(workspace, layername)
def patch_after_wfst(workspace, publication_type, publication, **kwargs):
task_methods = tasks_util.get_source_task_methods(get_publication_types()[publication_type], 'patch_after_wfst')
patch_chain = tasks_util.get_chain_of_methods(workspace, publication, task_methods, kwargs, 'layername')
res = patch_chain()
celery_util.set_publication_chain_info(workspace, publication_type, publication, task_methods, res)

0 comments on commit 887a1a5

Please sign in to comment.