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

feat: poll for all job completions in wait mode #3

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

gottyduke
Copy link
Contributor

Summary

Fixes an issue where the quantity parameter is not respected when creating an image with wait=True.

The _poll_for_job_completion will return job results as soon as there's at least one job completed (blobUrl available). If quantity was more than 1, it will not poll for all the jobs to finish. In this case, other jobs may still not be available yet.

Changes

This PR fixes _poll_for_job_completion so it polls for all jobs and only return if all job results are available or times out.

Note

If any job in the job batch fails (neither available nor scheduled), it'll wait until it times out.

@bryantanjw bryantanjw merged commit 6aa185b into civitai:main Jun 24, 2024
@bryantanjw
Copy link
Contributor

Nice! Looks good! Will include this change in the next release!

@gottyduke gottyduke deleted the feat/poll-for-all-wait-mode branch June 24, 2024 20:18
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.

2 participants