mirror of
https://github.com/blw1138/cross-py-builder.git
synced 2026-09-07 21:41:09 -05:00
The agent's background build threads called jsonify()/send_file() with no Flask app context, so after a successful build they crashed with 'Working outside of application context', which triggered the error handler that rmtree'd the whole build dir before the controller could download the artifact. Wrap both runners in app.app_context(). Also guard all three layers against empty results: the agent refuses to report success or serve a zip when dist/ has no files, and the scheduler flags a downloaded empty zip as a failure rather than marking the job done.