Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup tasks #364

Merged
merged 13 commits into from
Feb 28, 2025
Merged

cleanup tasks #364

merged 13 commits into from
Feb 28, 2025

Conversation

Audionut
Copy link
Owner

I was given the idea to except more than just keyboard interruptions, which sent me down a rabbit hole of checking tasks everywhere.

Turns out pooling with multiprocessing is async blocking which prevented proper handling (on windows at least) of CTRL+C.
Specifically creating and passing ProcessPoolExecutor instead of the default executor solved the lack of threading performance I was seeing previously.

upload_image_task is a blocking function, so run the tasks inside of a created executor thread, which then gives better handling of other async tasks (say keyboard interrupt) and doesn't use the default python executor.
@Audionut Audionut mentioned this pull request Feb 26, 2025
@Audionut Audionut merged commit bd71950 into master Feb 28, 2025
2 checks passed
@Audionut Audionut deleted the clean-tasks branch February 28, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant