I am having an issue at work with a python project I am working on (I normally use PHP/Java so am lacking a bit of knowledge).
Bascially I have a python program that I have built using Flask that connects an inventory management system to Shopify using the Shopify Python API.

When the user triggers a function via an AJAX request, I need to start a function/process that updates products in the client's Shopify store via the Shopify API. This takes about 2 hours (~7000 products plus have to pull them first from the inventory management system).
The issue is that I need a way that I can trigger this function/process, and even if the client closes their browser the function/process will continue running.

If there is any way I could update the front end with the current progress of this background function/process as well that would be swell.

If anyone knows of any library or resources for accomplishing this it would be much appreciated.
I have had a google, but all the solutions I can find seem to be for CLI scripts not Web scripts.

Thanks heaps, 
Corey :)