I'm currently working on a plugin that allows the user to select gcode-files stored in a database and print them.
Since I'd like to keep most logic in the backend, my current approach is to provide an endpoint ("UploadGcode") via the BlueprintPlugin, that can be triggered by the frontend and uploads the respective gcode via POSTing to api/files/local.
However, the POST request stays pending and is never finished.
I assume this is because flask is run in single thread mode and I'm unaware of how or where to change this to multithreading (searching for app.run() that would accept a threading parameter was unsuccessful).
Could someone provide some insights into how to configure it for multithreading, or another workaround?
Is it possible/good practice to directly call the methods executed by POSTing to api/files/local? And if so where can they be found?
As an alternative, I could return the gcode to the FE and then call api/files/local from there, but this seems like a suboptimal solution since it causes a lot of unneccessary traffic.
Thanks in advance!