kokoalberti / postgis-baselayers

Web application to download and import popular vector datasets (Natural Earth, GADM, Geonames, etc) into a PostGIS database with the click of a button.
MIT License
43 stars 9 forks source link

Web interface: Cancel tasks if they freeze somehow #6

Closed kokoalberti closed 5 years ago

kokoalberti commented 5 years ago

Tasks have a timeout which is currently at 1800 seconds (30 minutes). When the subprocess has not completed by then it is killed using process.kill(). This may take a while to complete as well, but when it does it returns with a negative return code (i.e. -9) and a InstallTerminated exception is raised, which in turn sets an error status in the database and marks the task as completed. In the future it may be interesting to look at terminating tasks manually using a 'Terminate' button, or setting custom timeouts for particular datasets.