kartoza / geosafe

InaSAFE package for Geonode
GNU General Public License v3.0
7 stars 16 forks source link

Clean up of layers in geosafe #228

Open NyakudyaA opened 7 years ago

NyakudyaA commented 7 years ago

Problem

After playing around with the geosafe I noticed a couple of odd things. They might not be bugs but can be improved.

File duplication

NB: Why can we not have a common place where the files are stored to avoid duplication?

Database

select * from geosafe_analysis;
 id |          user_title          |           impact_function_id            | extent_option |               task_id                | task_state | keep | report_map | report_table | aggregation_layer_id | exposur
e_layer_id | hazard_layer_id | impact_layer_id | user_id |                       user_extent                       |           end_time            |          start_time           
----+------------------------------+-----------------------------------------+---------------+--------------------------------------+------------+------+------------+--------------+----------------------+--------
-----------+-----------------+-----------------+---------+---------------------------------------------------------+-------------------------------+-------------------------------
  1 | Nepal earthquake on building | ClassifiedPolygonHazardBuildingFunction |             2 | 2037cd01-c780-4d0f-a053-67d37c42f6f9 | PENDING    | t    |            |              |                      |        
         3 |               1 |                 |    1000 | 85.2333068848,27.7030597274,85.3981018066,27.7769746959 | 2017-09-15 09:43:27.142444+00 | 2017-09-15 09:43:27.142434+00

NB: We should either change the database flag to reflect analysis failed in the database

save

Solution

Discussion and change when it is free time

boney-bun commented 7 years ago

the save button actives because a user wants to keep the analysis regardless what the result is. the user can simply disable the save button and it will be removed by the end of the day.

yes, the task status should change to failure if an analysis doesn't succeed. we have celery task for updating the status and it run asynchronously. my guess is it happened because of async process. the celery hasn't execute yet by the time you check it. i'm wondering does the task status change in the next day?