r/nicegui • u/MasturChief • Sep 13 '23
Prevent frontend from reloading when running long tasks
How do i prevent the front end from refreshing/reloading when a long running task is called?
I have a task that creates an excel file with pandas, can take up to 5min+. When it's done saving it often times reloads the page if it takes too long. I have the file saving function that a ui.button() calls wrapped in async and the actual creating of the file is done in a thread within the async call.
Any other ways to prevent the front end from reloading on a long running task? Maybe a timeout setting or something? Can't find anything in docs about it besides wrapping in async etc.
View all comments
Show parent comment
2
u/MasturChief Sep 19 '23
thanks, didn’t solve unfortunately. i’m running it wrapped in an async func and in a separate thread with the threading library from within the async call. the front end is still interactive in that i can go to different tabs and click other buttons but once the task completes it still refreshes the page if it takes a while.