Skip to content

Commit

Permalink
[Fixes #9184] Let final step work in async mode for layer replace (#9185
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mattiagiupponi authored Apr 20, 2022
1 parent f547e80 commit 1633775
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,12 +1210,21 @@ def layer_replace(request, layername, template='layers/layer_replace.html'):
request.GET = {"layer_id": layer.id}
steps = [None, "check", "final"] if layer.is_vector() else [None, "final"]
for _step in steps:
response, cat, valid = UploadViewSet()._emulate_client_upload_step(
request,
_step
)
if response.status_code != 200:
raise Exception(response.content)
if _step != 'final':
response, cat, valid = UploadViewSet()._emulate_client_upload_step(
request,
_step
)
if response.status_code != 200:
raise Exception(response.content)
else:
logger.error("starting final step for Replace Layer")
from geonode.upload.tasks import finalize_incomplete_session_uploads
if settings.ASYNC_SIGNALS:
logger.error("async starting")
finalize_incomplete_session_uploads.apply_async()
else:
finalize_incomplete_session_uploads.apply()

set_geowebcache_invalidate_cache(layer.typename)

Expand Down

0 comments on commit 1633775

Please sign in to comment.