If I have the following code:
$('#do-updates').click(function() {
$.post('/do_updates/',
function(response){
location.reload();
});
});
And the python function it calls is:
def do_update():
for item in items:
do something
The python function I call takes about 2m to finish.
If a user does the following:
1 - Click on the #do-updates button
2 - Navigate away from the page after 10s
What will happen? Will the entire do_updates() function run, because it is called asynchronously? Or will that function time out? If it does timeout, what's a better way to do the do_updates() function in the background so it will finish?