Parcel calculation to background #55

Closed
opened 2022-01-05 15:10:46 +01:00 by mpeltriaux · 2 comments
Owner

Status quo

Parcels are updated each time the geometry could have been changed. For larger geometries, where a few hundred parcels could be relevant, this update process takes more time due to the net traffic limitations of the used WFS. This slows done the whole HTTP response, since we need to wait for the update to finish. Users could be confused or get angry if the webapp does not respond in <1s.

Improvement

Move the parcel calculation into a background process. This way the HTTP response can be done, even with a still running parcel update.

Of course this leads to a side effect.

Old parcels still visible

In a case of 1000+ parcels the update might take up a few seconds and even longer. The update start the moment, a user hits the Save button on the form, where geometry is being processed. Since the update would be finished in a background process, the HTTP response could be delivered immediately to the user, which will be redirected on the detail view to see all of the changes, made to the data. But the parcels could still be the old ones!

Solution

  1. When the update is started, all parcels will be unlinked from the geometry directly, before the HTTP response is performed.
  2. The user will be redirected to the detail view
  3. If the geometry exists (is not None/empty) and there are no parcels currently linked to the geometry, we can assume the update process is still taking place.
  4. The parcel table won't be rendered now but instead a little message shows up, e.g. Parcel calculation ongoing. Please refresh this page in a while... to inform the user about what is going on right now and they should return later.
# Status quo Parcels are updated each time the geometry could have been changed. For larger geometries, where a few hundred parcels could be relevant, this update process takes more time due to the net traffic limitations of the used WFS. This slows done the whole HTTP response, since we need to wait for the update to finish. Users could be confused or get angry if the webapp does not respond in <1s. # Improvement Move the parcel calculation into a background process. This way the HTTP response can be done, even with a still running parcel update. Of course this leads to a side effect. ## Old parcels still visible In a case of 1000+ parcels the update might take up a few seconds and even longer. The update start the moment, a user hits the `Save` button on the form, where geometry is being processed. Since the update would be finished in a background process, the HTTP response could be delivered immediately to the user, which will be redirected on the detail view to see all of the changes, made to the data. **But the parcels could still be the old ones!** ### Solution 1. When the update is started, all parcels will be unlinked from the geometry directly, before the HTTP response is performed. 1. The user will be redirected to the detail view 1. If the geometry exists (is not None/empty) and there are no parcels currently linked to the geometry, we can assume the update process is still taking place. 1. The parcel table won't be rendered now but instead a little message shows up, e.g. `Parcel calculation ongoing. Please refresh this page in a while...` to inform the user about what is going on right now and they should return later.
mpeltriaux added the
enhancement
label 2022-01-05 15:10:53 +01:00
mpeltriaux self-assigned this 2022-01-05 15:10:56 +01:00
Author
Owner

Celery

Introduces celery to the project. Using celery, we are now able to process certain tasks in the background.

Frontend now

After saving changes to the dataset, the user will be redirected to the detail view as usual. The parcels are cleared directly, so none will be visible anymore. However, an info text will appear:
grafik

When the parcel calculation has been completed, the detail view will be able to list them again:
grafik

# Celery Introduces celery to the project. Using celery, we are now able to process certain tasks in the background. # Frontend now After saving changes to the dataset, the user will be redirected to the detail view as usual. The parcels are cleared directly, so none will be visible anymore. However, an info text will appear: ![grafik](/attachments/da4a842d-c1c6-41a7-aaa2-d84f02614061) When the parcel calculation has been completed, the detail view will be able to list them again: ![grafik](/attachments/638bcebb-ec69-401e-aba4-1b48d3ea0ea8)
Author
Owner

Merged in #58

# Merged in #58
btuelek referenced this issue from a commit 2024-12-05 13:18:36 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: IT-Naturschutz/konova#55
No description provided.