sdwebui-w-horde / sd-webui-stable-horde-worker

Stable Horde Unofficial Worker Bridge as Stable Diffusion WebUI (AUTOMATIC1111) Extension
GNU Affero General Public License v3.0
60 stars 19 forks source link

[Feature]: Delay Horde poll when a non-Horde job is already running #89

Closed Maeyanie closed 1 year ago

Maeyanie commented 1 year ago

Is there existing issue for this?

Feature Description

I've noticed the Horde poll will happen after the configured delay time from the previous submission, even if a local job submitted through the Web UI is running at the time. When we're busy ideally it would be better to let another worker handle the request if one is available, and if the local render is particularly long it can even result in the job giving a timed-out error when it's eventually completed and submitted.

Proposed Solution

The simplest and most effective way would probably be, when the timer expires, check if the WebUI is idle. If it isn't, restart the timer instead of polling.

Additional Information

No response