mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-03 19:02:27 +00:00
use condition to wait for result
This commit is contained in:
@@ -6,6 +6,7 @@ import gradio as gr
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List
|
||||
|
||||
from modules import call_queue
|
||||
from modules.shared import opts
|
||||
|
||||
import modules.shared as shared
|
||||
@@ -57,8 +58,9 @@ def restore_progress_call(task_tag):
|
||||
else:
|
||||
|
||||
t_task = current_task
|
||||
while t_task != last_task_id:
|
||||
time.sleep(2.5)
|
||||
with call_queue.queue_lock_condition:
|
||||
call_queue.queue_lock_condition.wait_for(lambda: t_task == last_task_id)
|
||||
|
||||
return last_task_result
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user