0

I currently have a React App that is using Axios to post data to a Python backend. The jobs are heavy and could take anywhere from 30 seconds to 5 minutes.

Currently, the application sits there loading until the job is done. If you navigate away from the page, while the backend process finishes, the frontend process no longer catches the response due to leaving the page.

I'd like to set it up so that the job continues to run, the user can navigate away from the page and do other things on the app. Then, when the job is complete, it updates the state (which prompts a notification to appear that the file is ready).

Does anyone know how to do this? Can maybe point me in the direction of some documentation that goes over this type of functionality?

Appreciate the help!

Masoud
  • 375
  • 1
  • 5
  • 16
jmelm93
  • 145
  • 1
  • 10
  • does your system has any endpoint to track the status of the job? – Sayooj V R Aug 15 '22 at 10:38
  • https://stackoverflow.com/a/25083057/13405106 – Usama Aug 15 '22 at 10:48
  • The system is only currently setup to start and accept the response from the job. I don't have it setup to send updates, but can look into that possibility if that'd lead to a potential path forward. – jmelm93 Aug 16 '22 at 03:39
  • Read through https://stackoverflow.com/questions/3527041/prevent-any-form-of-page-refresh-using-jquery-javascript/25083057#25083057 - the approach looks interesting. Will test this out. Thank you! – jmelm93 Aug 16 '22 at 03:40

0 Answers0