diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-06-27 06:02:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 06:02:38 +0000 |
commit | 58a9a261c4feb729717c386fea70f8ea985c6722 (patch) | |
tree | ebc822c17a889034672297d7450477f7c945cbb7 /modules/call_queue.py | |
parent | 373ff5a217eca33607abb692b9ebfa38abb7fe33 (diff) | |
parent | 2c43dd766da52d2ccaaa78d8f265a6a4aa33b9df (diff) | |
download | stable-diffusion-webui-gfx803-58a9a261c4feb729717c386fea70f8ea985c6722.tar.gz stable-diffusion-webui-gfx803-58a9a261c4feb729717c386fea70f8ea985c6722.tar.bz2 stable-diffusion-webui-gfx803-58a9a261c4feb729717c386fea70f8ea985c6722.zip |
Merge branch 'dev' into meta_class
Diffstat (limited to 'modules/call_queue.py')
-rw-r--r-- | modules/call_queue.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/modules/call_queue.py b/modules/call_queue.py index 447bb764..1b5e5273 100644 --- a/modules/call_queue.py +++ b/modules/call_queue.py @@ -1,10 +1,8 @@ import html
-import sys
import threading
-import traceback
import time
-from modules import shared, progress
+from modules import shared, progress, errors
queue_lock = threading.Lock()
@@ -23,7 +21,7 @@ def wrap_gradio_gpu_call(func, extra_outputs=None): def f(*args, **kwargs):
# if the first argument is a string that says "task(...)", it is treated as a job id
- if len(args) > 0 and type(args[0]) == str and args[0][0:5] == "task(" and args[0][-1] == ")":
+ if args and type(args[0]) == str and args[0].startswith("task(") and args[0].endswith(")"):
id_task = args[0]
progress.add_task_to_queue(id_task)
else:
@@ -56,16 +54,14 @@ def wrap_gradio_call(func, extra_outputs=None, add_stats=False): try:
res = list(func(*args, **kwargs))
except Exception as e:
- # When printing out our debug argument list, do not print out more than a MB of text
- max_debug_str_len = 131072 # (1024*1024)/8
-
- print("Error completing request", file=sys.stderr)
- argStr = f"Arguments: {args} {kwargs}"
- print(argStr[:max_debug_str_len], file=sys.stderr)
- if len(argStr) > max_debug_str_len:
- print(f"(Argument list truncated at {max_debug_str_len}/{len(argStr)} characters)", file=sys.stderr)
-
- print(traceback.format_exc(), file=sys.stderr)
+ # When printing out our debug argument list,
+ # do not print out more than a 100 KB of text
+ max_debug_str_len = 131072
+ message = "Error completing request"
+ arg_str = f"Arguments: {args} {kwargs}"[:max_debug_str_len]
+ if len(arg_str) > max_debug_str_len:
+ arg_str += f" (Argument list truncated at {max_debug_str_len}/{len(arg_str)} characters)"
+ errors.report(f"{message}\n{arg_str}", exc_info=True)
shared.state.job = ""
shared.state.job_count = 0
@@ -108,4 +104,3 @@ def wrap_gradio_call(func, extra_outputs=None, add_stats=False): return tuple(res)
return f
-
|