MCUpdater / MCU-Bootstrap

Bootstrapping auto-updater for MCUpdater
Apache License 2.0
4 stars 3 forks source link

Fix processQueue finishing to early #10

Closed llndqvst closed 3 years ago

llndqvst commented 3 years ago

Fixes a bug where DownloadQueue.processQueue tries to launch the program before the bootstrap has been completed.

Needed for https://github.com/MCUpdater/MCU-DownloadLib/pull/4

smbarbour commented 3 years ago

This change would break pack installation as it removes the TaskableExecutor from being passed in.

llndqvst commented 3 years ago

I'm not sure that's the case. That was the exact bug I was trying to fix, as you can see there wasn't even a TaskableExecutor passed in before, but a ThreadPoolExecutor which I believe is the root cause for the bug.

See https://github.com/MCUpdater/MCU-DownloadLib/pull/4/files#r570441814 where I added code to create the TaskableExecutor directly in DownloadQueue, since I didn't see any good reason to keep the creation of the executor in BootstrapForm.

If you prefer it that way I can update the pull request to reflect that, but please review the two changes together. I have tested both my own pack and http://files.mcupdater.com/example/SamplePack.xml and everything seems to work.

I somehow missed the references to processQueue in MCU-API when i looked through the project. Updating the pull request.

llndqvst commented 3 years ago

I’ve made some changes, and the launcher should now work properly. Please review