OpenTechFund / bypass-otf_proxy

1 stars 1 forks source link

Automated remove for cloudfront takes too long for web #73

Open maxpearl opened 3 years ago

maxpearl commented 3 years ago

The automated replace function for cloudfront (and likely other services) takes far too long for flask - the page load will time out before the waiter for the distribution is complete. The waiter works, and the new distribution is created, but it's not getting the info on the new URL back to flask.

Probably the best strategy is to split off a separate process that will wait, then populate github and database with new URL, and have the main process simply go back with a flashed message about "new distribution creation is in process" or some such.

maxpearl commented 3 years ago

Also, automation.py returns True or False, not the url of the mirror. Probably automation.py is the place to put the different processes.

maxpearl commented 2 years ago

Upon more detailed look at this code - this is not the issue. The issue is waiting for the disabling before the deletion - that's what's taking the time. The new distribution info is returned immediately in the new distribution step.

So the place to put the separate process is in aws_functions - just spin of a process to disable, wait and delete.